Numbers Prefer Multiplication

    lrs-xml-parser

    1.0.1 • Public • Published

    TCO Megahack - XML Parser

    Requirements

    • Node.js 6.9.1
    • mongodb

    Configuration

    Edit config/config.js and change mongo_uri to the value for your environment.


    Using the module

    The module exposes three methods:

    • getNaicsCodes
    • getPrograms
    • getCleanAirActRules

    getNaicsCodes

    This method accepts two parameters: xmlFilename and callback and stores the NAICS codes in the Naics collection.

    xmlFilename represents the full path to the XML file containing the NAICS codes.

    callback represents the callack to be called after the NAICS codes have been retrieved and stored in MongoDB


    getPrograms

    This method accepts three parameters: xmlFilename, baseFolder and callback and stores the retrieved programs and their corresponding rules / regulation IDs in the Program collection. This method may take a while to complete depending on the number of CFR files that need to be parsed and their respective file sizes.

    xmlFilename represents the full path to the XML file containing the programs.

    baseFolder represents the path to the folder containing the CFR2015Title40XXX files.

    callback represents the callack to be called after the programs have been retrieved and stored in MongoDB.


    getCleanAirActRules

    This method accepts two parameters: baseFolder and callback and stores the retrieved rules with their regulation IDs in the Rule collection. This method may take a while to complete depending on the number of CFR files that need to be parsed and their respective file sizes.

    baseFolder represents the path to the folder containing the CFR2015Title40XXX files.

    callback represents the callack to be called after the programs have been retrieved and stored in MongoDB.

    Install

    npm i lrs-xml-parser

    DownloadsWeekly Downloads

    3

    Version

    1.0.1

    License

    none

    Last publish

    Collaborators

    • shockr