arr-to-map

1.0.3 • Public • Published

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

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    30
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    30
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i arr-to-map

Weekly Downloads

30

Version

1.0.3

License

BSD-2-Clause

Last publish

Collaborators

  • nafsadh