1.0.4 • Published 7 years ago

onlydata v1.0.4

Weekly downloads
13
License
Apache-2.0
Repository
github
Last release
7 years ago

OnlyData Node Parser build status npm version

The official node.js parser for OnlyData, a human-readable data serialization language.

Install

npm install onlydata

API

var onlydata = require('onlydata');

// values
var str = 'a string of OnlyData syntax';
var buff = new Buffer('OnlyData stuff');
var file = 'path/to/file.onlydata';
// or      'path/to/file.only';
// or      'path/to/file.od';

// parse string
obj = onlydata(str);
obj = onlydata.parse(str);
obj = onlydata.parseString(str);

// parse buffer
obj = onlydata(buff);
obj = onlydata.parse(buff);
obj = onlydata.parseBuffer(buff);

// parse file
obj = onlydata(file);
obj = onlydata.parse(file);
obj = onlydata.parseFile(file);

// get config
onlydata.getConfig([ ...prop ]); // prop array
onlydata.getConfig(...prop);     // prop arguments
onlydata.getConfig();            // all props

// set config
onlydata.setConfig(propKey, newVal);
onlydata.setConfig({
  propKey: newVal,
  propKey: newVal
});

// reset config
onlydata.resetConfig([ ...prop ]); // prop array
onlydata.resetConfig(...prop);     // prop arguments
onlydata.resetConfig();            // all props

// make new instance
onlydata = onlydata.construct();
onlydata = onlydata.constructor();

Other Details

contributing: see contributing guide bugs/improvements: open an issue questions: adam@imaginate.life

1.0.4

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

1.0.0-beta.3

8 years ago

1.0.0-beta.2

8 years ago

1.0.0-beta.1

8 years ago

1.0.0-beta

8 years ago

0.0.1-beta

8 years ago

0.0.1-alpha

8 years ago