0.1.2 • Published 9 years ago
ensure-keys v0.1.2
ensure-keys
ensure a json has specific keys
Installation
This module is installed via npm:
$ npm install ensure-keys --save
Example Usage
var ensureKeys = require('ensure-keys');
var json = {
name: 'bigruan',
age: 12,
child: {
name: 'yulong',
age: 1
}
}
// return the keys that not exists or has value: undefined, null and ''
ensureKeys(json, ['name', 'job', 'child.name']); // -> ['job']