lodash-traits
Version:
Traits for lodash
34 lines (22 loc) • 1.23 kB
Markdown
# lodash-traits     
> Traits for [lodash](https://lodash.com/)
This module exposes a trait set with all the functions from lodash.
It's mainly meant to be used with [straits](https://straits.github.io/).
## Installation
```bash
npm install --save lodash-traits
```
## Usage
All the lodash functions are exposed as traits.
You can use them with the [straits syntax](https://straits.github.io/syntax/):
```javascript
const lodashTraits = require('lodash-traits');
use traits * from lodashTraits;
const object = { a:7, b:12, c:4, d:7, e:1 };
const result = object
.*values()
.*sortBy()
.*uniq();
// result: [1, 4, 7, 12]
```
or by explicitly using symbol properties or free functions. Give a look at [`test/index.js`](https://github.com/peoro/lodash-traits/blob/master/test/index.js) for more examples.