multiobject
v0.1.1
Published
It parses an object that may contains multiple data
Downloads
3
Maintainers
Readme
Multiple object/json parser
Multiobject
is a fast and simple library to parse multiple objects.
Install
npm i multiobject --save
Api
Multiobject implements one method:
parse (object: Object, params: Array or String (optional), delimiter: String (optional)): Object
Use
const multiobject = require('multiobject')
let multipleData = {
a: 1,
'a.dev': 2,
'a.prod': 3,
b: {
a: 1,
'a.dev': 2
}
}
console.log('mo without params', multiobject(multipleData))
// out {a: 1, b: {a: 1}}
console.log('mo with dev: ', multiobject(multipleData, 'dev'))
// out {a: 2, b: {a: 2}}
console.log('mo with prod: ', multiobject(multipleData, 'prod'))
// out {a: 3, b: {a: 1}}