pdsparser

1.0.1 • Public • Published

PDSParser

PDS Configuration file parser

Getting started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i pdsparser
# or 
$ yarn add pdsparser

Example of parsing a UIM Configuration file

<setup>
    loglevel = 5
    probes = cdm,dirscan,processes
</setup>
const pdsparser = require('pdsparser');
 
async function main() {
    const config = await (new pdsparser('./script.cfg')).read();
    
    const loglevel  = config.setup.loglevel || 5;
    const probes  = (config.setup.probes || '').split(',');
}
main().catch(console.error);

Use destructuration to simplify readability

const {
    setup: {  
        loglevel = 5,
        probes = ''
    }
= await (new pdsparser('./script.cfg')).read();

Readme

Keywords

none

Package Sidebar

Install

npm i pdsparser

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

10 kB

Total Files

8

Last publish

Collaborators

  • fraxken