extract

1.0.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    53
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    53
  • 0.1.0
    1
  • 0.0.2
    2
  • 0.0.1
    0

Package Sidebar

Install

npm i extract

Weekly Downloads

52

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jfromaniello