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

    extractpublic

    Extract properties from objects and generate a new object.

    Installation

    npm install extract
    

    Usage

    var extract = require('extract');
    var sample = {foo: 123, bar: 'baz'};
    var result = extract(sample, ['foo'])
     
    console.log(result);

    Will print {foo: 123}.

    Why?

    I use this pattern quite a lot in node.js to deal with things such as mass-assignment.

    License

    MIT

    Keywords

    none

    install

    npm i extract

    Downloadslast 7 days

    131

    version

    1.0.0

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar