3.0.2 • Published 7 years ago

ca-highway-conditions-parser v3.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

ca-highway-conditions-parser

Installation

$ npm install --save ca-highway-conditions-parser

Usage

Parsing

import parser from 'ca-highway-conditions-parser';

const input = `
SR 20
    [IN THE NORTHERN CALIFORNIA AREA]
    1-WAY CONTROLLED TRAFFIC FROM 5.5 MI EAST OF THE JCT OF SR 16 TO "E" ST
/IN WILLIAMS/ (COLUSA CO) - DUE TO FLOODING
`;

parser(input).then(
  (notices) => console.log(notices[20]),
  (error) => console.error(`Failed to parse input: ${error}`)
);

Output

{
    "20": {
        "type": "SR",
        "highway": "20",
        "notices": [
            {
                "title": "IN THE NORTHERN CALIFORNIA AREA",
                "messages": [
                    "1-WAY CONTROLLED TRAFFIC FROM 5.5 MI EAST OF THE JCT OF SR 16 TO \"E\" ST /IN WILLIAMS/ (COLUSA CO) - DUE TO FLOODING"
                ]
            }
        ]
    }
}
3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago