Nicely Pointed Mandibles
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    hash-arraypublic

    node-hash-array Build Status

    hashify array and get element by its key

    Installation

    $ npm install hash-array

    Usage

    var hashArray = require('hash-array');
    var src = [
      { 'type': 'mail', value: 30 },
      { 'type': 'foll', value: 20 }
    ]
    var hashedArr = hashArray(src, type);
    console.log(hashedArr.get('mail')) // prints 30
    console.log(hashedArr.get('foll')) // prints 20

    API

    hashArray(src, key)

    Scan a source array src, and generate a new object based on passed 2nd argument key

    .get(key)

    Get value from your hashed array

    .set(key, val)

    Set value to your hashed array and source array

    License

    MIT

    Keywords

    install

    npm i hash-array

    Downloadsweekly downloads

    3

    version

    0.0.1

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar