arr-to-map

create a map from items of an array, using one property as 'key'

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
arr-to-map
001.0.37 years ago7 years agoMinified + gzip package size for arr-to-map in KB

Readme

arr-to-map
Simple function for converting arrays into maps by looking into one 'key' field npm
Install
To install run following command npm install arr-to-map To add it to your project's package.json run npm install arr-to-map --save
Usage
```javascript var arrToMap = require('arr-to-map'); let fruitsArray = {name:'mango', species:'Mangifera indica'}, {name:'orange', species:'Citrus reticulata'} ; let fruitsMap = arrToMap(fruitsArray, 'name'); console.log(fruitsMap); ```
License
BSD 2-Clause License Copyright © 2017, nafSadh http://nafSadh.com All rights reserved.