Skip to content

Commit 4f279f2

Browse files
committed
generate docs
1 parent bbf8aef commit 4f279f2

File tree

2 files changed

+71
-27
lines changed

2 files changed

+71
-27
lines changed

.verb.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
{%= include("install-bower", {save: true}) %}
22

33
## Usage
4-
{%= apidocs("index.js") %}
4+
5+
Returns the difference between the first array and additional arrays.
6+
7+
```js
8+
var diff = require('{%= name %}');
9+
10+
var a = ['a', 'b', 'c', 'd'];
11+
var b = ['b', 'c'];
12+
13+
console.log(diff(a, b))
14+
//=> ['a', 'd']
15+
```
16+
17+
## Benchmarks
18+
19+
This library versus [array-differ][], on {%= date() %}:
20+
21+
```
22+
{%= docs("benchmark/last.md") %}
23+
```

README.md

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
1-
# arr-diff [![NPM version](https://img.shields.io/npm/v/arr-diff.svg)](https://www.npmjs.com/package/arr-diff) [![Build Status](https://img.shields.io/travis/jonschlinkert/arr-diff.svg)](https://travis-ci.org/jonschlinkert/arr-diff)
1+
# arr-diff [![NPM version](https://img.shields.io/npm/v/arr-diff.svg?style=flat)](https://www.npmjs.com/package/arr-diff) [![NPM downloads](https://img.shields.io/npm/dm/arr-diff.svg?style=flat)](https://npmjs.org/package/arr-diff) [![Build Status](https://img.shields.io/travis/jonschlinkert/arr-diff.svg?style=flat)](https://travis-ci.org/jonschlinkert/arr-diff)
22

3-
> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
3+
Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
44

55
## Install
66

7-
Install with [npm](https://www.npmjs.com/)
7+
Install with [npm](https://www.npmjs.com/):
88

99
```sh
10-
$ npm i arr-diff --save
10+
$ npm install arr-diff --save
1111
```
12+
1213
Install with [bower](http://bower.io/)
1314

1415
```sh
1516
$ bower install arr-diff --save
1617
```
1718

18-
## API
19-
20-
### [diff](index.js#L33)
21-
22-
Return the difference between the first array and additional arrays.
23-
24-
**Params**
19+
## Usage
2520

26-
* `a` **{Array}**
27-
* `b` **{Array}**
28-
* `returns` **{Array}**
29-
30-
**Example**
21+
Returns the difference between the first array and additional arrays.
3122

3223
```js
3324
var diff = require('arr-diff');
@@ -39,36 +30,70 @@ console.log(diff(a, b))
3930
//=> ['a', 'd']
4031
```
4132

33+
## Benchmarks
34+
35+
This library versus [array-differ](https://github.com/sindresorhus/array-differ), on May 07, 2016:
36+
37+
```
38+
# benchmark/fixtures/long.js (94529 bytes)
39+
current x 1,246 ops/sec ±0.98% (85 runs sampled)
40+
array-differ x 993 ops/sec ±1.35% (87 runs sampled)
41+
42+
# benchmark/fixtures/med.js (708 bytes)
43+
current x 583,612 ops/sec ±1.24% (87 runs sampled)
44+
array-differ x 464,480 ops/sec ±1.42% (85 runs sampled)
45+
46+
# benchmark/fixtures/short.js (60 bytes)
47+
current x 788,823 ops/sec ±0.95% (89 runs sampled)
48+
array-differ x 521,483 ops/sec ±1.65% (86 runs sampled)
49+
```
50+
4251
## Related projects
4352

53+
You might also be interested in these projects:
54+
4455
* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten)
4556
* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter)
4657
* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://www.npmjs.com/package/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection)
4758

48-
## Running tests
59+
## Contributing
4960

50-
Install dev dependencies:
61+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-diff/issues/new).
62+
63+
## Building docs
64+
65+
Generate readme and API documentation with [verb](https://github.com/verbose/verb):
5166

5267
```sh
53-
$ npm i -d && npm test
68+
$ npm install verb && npm run docs
5469
```
5570

56-
## Contributing
71+
Or, if [verb](https://github.com/verbose/verb) is installed globally:
5772

58-
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-diff/issues/new).
73+
```sh
74+
$ verb
75+
```
76+
77+
## Running tests
78+
79+
Install dev dependencies:
80+
81+
```sh
82+
$ npm install -d && npm test
83+
```
5984

6085
## Author
6186

6287
**Jon Schlinkert**
6388

64-
+ [github/jonschlinkert](https://github.com/jonschlinkert)
65-
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
89+
* [github/jonschlinkert](https://github.com/jonschlinkert)
90+
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
6691

6792
## License
6893

69-
Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
70-
Released under the MIT license.
94+
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
95+
Released under the [MIT license](https://github.com/jonschlinkert/arr-diff/blob/master/LICENSE).
7196

7297
***
7398

74-
_This file was generated by [verb](https://github.com/verbose/verb) on Sat Dec 05 2015 23:24:53 GMT-0500 (EST)._
99+
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 07, 2016._

0 commit comments

Comments
 (0)