Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deep-pluck

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-pluck

Recursively grab the values of all keys within a deeply nested object

  • 0.1.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-35%
Maintainers
1
Weekly downloads
 
Created
Source

Deep Pluck

deepPluck(<haystack>, <needle>);

Returns an array containing the values of all keys in haystack that match needle.

Installation

npm i deep-pluck

Example

// A ``<script>`` consumable build provided in ``./dist``.
var deepPluck = require('deep-pluck');
var data = {
  foo: {
    bar: {
      'biz': 1
     }
  },
  bar:{
    baz: {
      'biz': 2
     }
  }
}

deepPluck(data, 'biz')
=> [1, 2]

Testing

Run client and server specs

$ npm test

Run client specs in Safari, Chrome, and Firefox

$ gulp test:client:all

Run client specs on Sauce Labs (requires sauce account credentials be added to sauce-config.json)

$ gulp test:client:sauce

Run server specs

$ gulp test:server

Continuously client tests (via PhantomJS) during development

$ gulp

Browser Support

Chrome Firefox Safari ie8+

FAQs

Package last updated on 13 Jun 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc