An open API service indexing awesome lists of open source software.

https://github.com/cshum/extract-object

Extract text tokens from serializable object
https://github.com/cshum/extract-object

Last synced: 29 days ago
JSON representation

Extract text tokens from serializable object

Awesome Lists containing this project

README

        

# extract-object

Extract text tokens from serializable object.

[![Build Status](https://travis-ci.org/cshum/extract-object.svg)](https://travis-ci.org/cshum/extract-object)

```
npm install extract-object
```

### extract(obj, [tokens])

Extract text tokens from serializable `obj`, optionally pass array `tokens` as reference.

```js
var extract = require('extract-object')

console.log(extract({
a: 'foo bar',
c: ['hello'],
d: { asdf: { ghjk: 'world' } },
e: 167,
f: null
}))

// ['foo bar', 'hello', 'world']
```

## License

MIT