tree-values

Shake the values out a tree object

Usage no npm install needed!

<script type="module">
  import treeValues from 'https://cdn.skypack.dev/tree-values';
</script>

README

tree-values Build Status

Get the values of an object, recursively.

Install

$ npm install --save tree-values

Usage

const values = require('tree-values');

values({foo: 0, bar: 1});
//=> [0, 1]

Recursive example:

var nestedObj = {
  a: 'foo',
  b: {x: 1, y: 2}
}

values(nestedObj);
//=> ['foo', 1, 2]

Tests

npm install
npm test

Dependencies

None

Dev Dependencies

  • mocha: simple, flexible, fun test framework

License

MIT