ca-highway-conditions-parser

3.0.2 • Public • Published

ca-highway-conditions-parser

NPM Version

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

[
  {
    "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"
        ]
      }
    ]
  }
]

Package Sidebar

Install

npm i ca-highway-conditions-parser

Weekly Downloads

2

Version

3.0.2

License

MIT

Last publish

Collaborators

  • cameronhunter