morphism
Helps you to transform any object structure to another
Installation
$ npm install --save morphism
Usage
var morphism = require('morphism');
let dataToCrunch = [{
'firstName': 'John',
'lastName': 'Smith',
'age': 25,
'address':
{
'city': 'New York',
'state': 'NY',
'postalCode': '10021'
}
}];
let schema = {
pseudo: 'firstName',
lastName: 'lastName',
city: 'address.city'
state: {
path: 'address.state',
fn: (state) => state.toLowerCase()
},
status: () => 'morphed'
};
let results = Morphism(schema, dataToCrunch);
License
MIT © Yann Renaudin