pickit

0.1.1 • Public • Published

pickit

Build Status Code Climate Coverage Status Dependency Status devDependency Status

var pick = require('pickit');

var array = [
  {name: 'James', age: 36, siblings: 3},
  {name: 'Susan', age: 40, siblings: 2},
  {name: 'Noah', age: 4, siblings: 1}
];

// supply a callback
pick.max(array, function (x) {return x.age;}); // {name: 'Susan', ...}

// or a string property name
pick.max(array, 'siblings');                   // {name: 'James', ...}
pick.min(array, 'siblings')/                   // {name: 'Noah', ...}

polyfill

pickit requires that Array.prototype.reduce be implemented (IE 9 or greater). A copy of the standard polyfill is included for your convenience (reduce-polyfill.js).

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i pickit

    Weekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • jamestalmage