slept-sort
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Contains cat GIF

Vanilla GIF

Dependents (0)

Package Sidebar

Install

npm i slept-sort

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

13.6 kB

Total Files

24

Last publish

Collaborators

  • aomkirby123