New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

extract

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract

Extract specific properties from objects and generate new one.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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

extract

FAQs

Package last updated on 07 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts