1.0.0 • Published 11 years ago

extract v1.0.0

Weekly downloads
44
License
-
Repository
github
Last release
11 years ago

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

1.0.0

11 years ago

0.1.0

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago