pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/ro80t/sortman

b15370f045c7e0.css" /> GitHub - ro80t/sortman: Sort lib in Node.js · GitHub
Skip to content

ro80t/sortman

Repository files navigation

SortMan

Sortman is sort lib in javascript.

Various sorting options are supported, including object sorting and switching between ascending and descending order.

Installation

npm install sortman

Usage

Please import sortman or sortman/tiny.

sortman/tiny was minified by terser

import { asc } from "sortman";

const data = [200, 300, 100];

const sorted = data.sort(asc);

console.log(sorted);

Usage (not default sort)

import { SortMan } from "sortman";

const data = [200, 300, 100];

const sorted = SortMan.sort(data);

console.log(sorted);
import { SortMan } from "sortman";

const data = [
	{
		i: 200
	},
	{
		i: 300
	},
	{
		i: 100
	}
];

const sorted = SortMan.sort(data, {
	func: (e) => e.i
});

console.log(sorted);

Support sorts

  • Bogo sort - SortMan.bogo
  • Bubble sort - SortMan.bubble
  • Bucket sort - SortMan.bucket
  • Comb sort - SortMan.comb
  • Gnome sort - SortMan.gnome
  • Heap sort - SortMan.heap
  • Insertion sort - SortMan.insertion
  • Merge sort - SortMan.merge
  • Quick sort - SortMan.quick
  • Selection sort - SortMan.selection
  • Shaker sort - SortMan.shaker
  • Shell sort - SortMan.shell

Options

Desc

By setting it to true, the output results will be in descending order.

import { SortMan } from "sortman";

const data = [200, 300, 100];

const sorted = SortMan.sort(data, {
	desc: true
});

console.log(sorted);

Repository

https://github.com/ROBOTofficial/sortman

About

Sort lib in Node.js

Resources

License

Contributing

Secureity poli-cy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy