npm.io
0.0.4 • Published 12 years agoCLI

recurse-delete-property

Licence
MIT
Version
0.0.4
Deps
1
Vulns
0
Weekly
0
Stars
1

Recursively delete a property in object.

Install

npm i recurse-delete-property

Usage

var rdp = require('recurse-delete-property');
console.log(rdp({ foo: 123, bar: 456, baz: { foo: 543 }}));

// prints:
  { bar: 456, baz: {  } }

Command Line

echo '{ "foo": 123, "bar": 445 }' | recurse-delete-property -p foo -i 2

#prints:

{
  "bar": 445
}

I use this to delete some unwanted properties in npm-shrinkwrap.

License

MIT 2014 - Jose Romaniello