csv-config

A `CSV` config parser and serializer for node.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
csv-config
1.1.75 years ago5 years agoMinified + gzip package size for csv-config in KB

Readme

csv-config
A CSV config parser and serializer for node
version downloads node status

Installation

npm install csv-config

Usage

Reading Config Files at Current Working Directory cwd

const CsvConfig = require('csv-config');

let config = CsvConfig("CsvConfig",true);

//reading config values
let data01=config['conf-01'].data[0][0];
let data02=config['conf-02'].data[0][0];
let data03=config['conf-03'].data[0][0];

//updating
config['conf-01'].data[0][1] = 1;
config['conf-02'].data[0][1] = 2;
config['conf-03'].data[0][1] = 3;

//saving configs
config.save();

Reading Config Files at User Home Directory

const CsvConfig = require('csv-config');

let config = CsvConfig("CsvConfig");

//reading config values
let data01=config['conf-01'].data[0][0];
let data02=config['conf-02'].data[0][0];
let data03=config['conf-03'].data[0][0];

//updating
config['conf-01'].data[0][1] = 1;
config['conf-02'].data[0][1] = 2;
config['conf-03'].data[0][1] = 3;

//saving configs
config.save();

Test

mocha or npm test
check test folder and QUICKSTART.js for extra usage.