slept-sort
v1.1.0
Published
Asynchronously sleep sort
Downloads
2
Maintainers
Readme
Slept Sort
Asynchronously sleep sort.
What is...
An implementation of sleep sort in JavaScript asynchronously.
Basically, it will sort array of number by n ms
where n is value of member of the array.
Time Complexity of sleep sort is unpredictable but I like to call it O(wtf(N))
.
It's neither fast nor slow without an absolute input, just pure chaos like Schordinger's cat.
Why use Slept Sort
Slept Sort is:
- Pure function
- TypeScript support
- Multiple module to choose from
- Lightweight
Example Usage
It's basically:
import sleptSort from 'slept-sort'
let someAsyncFunction = async() => {
await sleptSort([3,1,2]) // [1,2,3]
}
For some reason, you might interested in pre-built module:
import sleptSort from 'slept-sort/dist'
let someAsyncFunction = async() => {
await sleptSort([3,1,2]) // [1,2,3]
}
Or use other module resolution:
const sleptSort = require('slept-sort/dist/cjs')
let someAsyncFunction = async() => {
await sleptSort([3,1,2]) // [1,2,3]
}
The reason why you might interested in Slept Sort is because it