Skip to content

Commit 62ae091

Browse files
author
Aurélien Ooms
committed
Update README.md
1 parent 69ba78e commit 62ae091

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,23 @@ Sorting code bricks for JavaScript.
1414
[![NPM downloads per month](http://img.shields.io/npm/dm/aureooms-js-sort.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-sort)
1515
[![GitHub issues](http://img.shields.io/github/issues/aureooms/js-sort.svg?style=flat)](https://github.com/aureooms/js-sort/issues)
1616

17+
Can be managed through [bower](https://github.com/bower/bower),
18+
[component](https://github.com/componentjs/component), or
19+
[npm](https://github.com/npm/npm).
20+
21+
```js
22+
let sort = require( "aureooms-js-sort" ) ;
23+
```
24+
1725
Example usage:
1826

1927
```js
20-
compare = require( "aureooms-js-compare" ) ;
21-
sort = require( "aureooms-js-sort" ) ;
28+
let compare = require( "aureooms-js-compare" ) ;
2229

2330
/** quicksort using hoare partitioning */
24-
quicksort = sort.__quicksort__( sort.hoare ) ;
31+
let quicksort = sort.__quicksort__( sort.hoare ) ;
2532

26-
a = [ 1 , 6 , 5 , 3 , 2 , 4 ] ;
33+
let a = [ 1 , 6 , 5 , 3 , 2 , 4 ] ;
2734

2835
quicksort( compare.increasing , a , 0 , a.length ) ;
2936

@@ -36,19 +43,19 @@ a ; // [ 6 , 5 , 4 , 3 , 2 , 1 ]
3643
// but also
3744

3845
/** binary heapsort */
39-
heapsort = sort.__heapsort__( 2 ) ;
46+
let heapsort = sort.__heapsort__( 2 ) ;
4047
/** ternary heapsort */
41-
heapsort = sort.__heapsort__( 3 ) ;
48+
let heapsort = sort.__heapsort__( 3 ) ;
4249
/** quicksort (lomuto) */
43-
quicksort = sort.__quicksort__( sort.lomuto ) ;
50+
let quicksort = sort.__quicksort__( sort.lomuto ) ;
4451
/** dualpivotquicksort (yaroslavskiy) */
45-
quicksort = sort.__dualpivotquicksort__( sort.yaroslavskiy ) ;
52+
let quicksort = sort.__dualpivotquicksort__( sort.yaroslavskiy ) ;
4653
/** insertionsort */
47-
insertionsort = sort.insertionsort ;
54+
let insertionsort = sort.insertionsort ;
4855
/** selectionsort */
49-
selectionsort = sort.selectionsort ;
56+
let selectionsort = sort.selectionsort ;
5057
/** bubblesort */
51-
bubblesort = sort.bubblesort ;
58+
let bubblesort = sort.bubblesort ;
5259
```
5360

5461
Reference:

0 commit comments

Comments
 (0)