Extract specific properties from objects and generate new one.
Extract properties from objects and generate a new object.
npm install extract
var extract = require'extract';var sample = foo: 123 bar: 'baz';var result = extractsample 'foo'console.logresult;
I use this pattern quite a lot in node.js to deal with things such as mass-assignment.