Noncommital Premarital Mischief
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

csv-config

1.1.7 • Public • Published

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.

Install

npm i csv-config

DownloadsWeekly Downloads

505

Version

1.1.7

License

MIT

Last publish

Collaborators

  • avatar