ts-sort-utils
sync + callback + Promise + Async/Await style sort array utils implementation in typescript
- bubbleSort,
- bubbleSortSync,
- bubbleSortAsync,
- bucketSort,
- bucketSortSync,
- bucketSortAsync,
- countingSort,
- countingSortSync,
- countingSortAsync,
- heapSort,
- heapSortSync,
- heapSortAsync,
- insertionSort,
- insertionSortSync,
- insertionSortAsync,
- mergeSort,
- mergeSortSync,
- mergeSortAsync,
- quickSort,
- quickSortSync,
- quickSortAsync,
- radixSort,
- radixSortSync,
- radixSortAsync,
- selectionSort,
- selectionSortSync,
- selectionSortAsync,
- shellSort,
- shellSortSync,
- shellSortAsync
Install
npm install ts-sort-utils --save-devyarn add ts-sort-utils -D
Usages Api for cjs
bubbleSort bubbleSortSync bubbleSortAsync bucketSort bucketSortSync bucketSortAsync countingSort countingSortSync countingSortAsync heapSort heapSortSync heapSortAsync insertionSort insertionSortSync insertionSortAsync mergeSort mergeSortSync mergeSortAsync quickSort quickSortSync quickSortAsync radixSort radixSortSync radixSortAsync selectionSort selectionSortSync selectionSortAsync shellSort shellSortSync shellSortAsync
Usages Api for es6
from 'ts-sort-utils'
commonjs use [sync + callback + Promise + Async/Await]
var quickSort = quickSort; var quickSortSync = quickSortSync;console// output: [2,3, 4, 27, 57,100,343] var quickSortAsync = quickSortAsync; var quickSortAsyncW = quickSortAsync; { var array4 = 3457210027343 var les = await console // output: [2,3, 4, 27, 57,100,343]} var quickSortAsyncAwait = quickSortAsyncAwait; { var array4 = 3457210027343 var les = await console // output: [2,3, 4, 27, 57,100,343]}
es6 use [sync + callback + Promise + Async Await]
console { var array4 = 3457210027343 var les = await console // output: [2,3, 4, 27, 57,100,343]}
umd web browser use [sync + callback + Promise + Async Await]
<script src="https://unpkg.com/ts-sort-utils@1.0.1/umd/index.js"></script> tsSortUtils console tsSortUtils { var array4 = 3457210027343 var les = await tsSortUtils console // output: [2,3, 4, 27, 57,100,343]}...
Dependencies Packages
-
ts-sort-bubble
GitHub repo, NPM -
ts-sort-bucket
GitHub repo, NPM -
ts-sort-counting
GitHub repo, NPM -
ts-sort-heap
GitHub repo, NPM -
ts-sort-insertion
GitHub repo, NPM -
ts-sort-merge
GitHub repo, NPM -
ts-sort-quick
GitHub repo, NPM -
ts-sort-radix
GitHub repo, NPM -
ts-sort-selection
GitHub repo, NPM -
ts-sort-shell
GitHub repo, NPM
API
- arr - The array to sort in place
- callback - function to get sort array result