json-indexify
Version:
[](https://travis-ci.org/prateekpronoc/json-indexify) [](https://c
33 lines (13 loc) • 864 B
Markdown
# json-indexify
[](https://travis-ci.org/prateekpronoc/json-indexify) [](https://coveralls.io/github/prateekpronoc/json-indexify?branch=master)
A small library that indexify the array of json objects
## Installation
`npm install json-indexify`
## Usage
var indexify = require('json-indexify');
var indexifiesObject = indexify([{ id: 91, value: 'India' }, { id: 1, value: 'USA' }],'id','value');
Output should be `{'1': 'USA', '91': 'India'}`
## Tests
`npm test`
## Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.