Skip to content

simple key extractor for objects and arrays

License

Notifications You must be signed in to change notification settings

ahmetozantekin/extrode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extrode

Build Status Coverage Status npm version

A small library that extracts specified keys from a single object or objects in an array.

Installation

npm install extrode

Usage

  • Example usage for object arrays:
var extrode = require('extrode');
var dirtyArray = [{ x: 1, y: 2 }, { x: 3, y: 4 }, { x: 5, y: 6}];

var result = extrode(dirtyArray, ['x']);

Output should be [{ x: 1 }, { x: 3 }, { x: 5 }]

  • Example usage for a single object:
var extrode = require('extrode');
var dirtyObject = { x: 1, y: 2 };

var result = extrode(dirtyObject, ['x']);

Output should be { x: 1 }

Tests

npm test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

About

simple key extractor for objects and arrays

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published