Return the key and value of the given JS Object
var getKeyValue = require('get-js-object-key-value')
getKeyValue(object:JSObject)
the JSObject can be an object with one or more properties
- one property should return a js object with {key, value}
- more than one property should return an array with [{key, value}, {key, value}]
- undefined in case to pass an empty JS Object
var getKeyValue = require('get-js-object-key-value');
var scripts = require('./package.json').scripts;
var arr = getKeyValue(scripts);
[
{ key: 'test', value: 'lab -v -c test.js' },
{ key: 'jshint', value: 'jshint -c .jshintrc *.js' },
{ key: 'code-style', value: 'jscs -p google *.js' },
{ key: 'check-coverage',
value: 'lab -t 100 -r html -o coverage.html test.js' },
{ key: 'open-coverage', value: 'open coverage.html' }
]
this projet has been set up with a precommit that forces you to follow a code style, no jshint issues and 100% of code coverage before commit
to run test
npm test
to run jshint
npm run jshint
to run code style
npm run code-style
to run check code coverage
npm run check-coverage
to open the code coverage report
npm run open-coverage