UNPKG

utilict

Version:

The JavaScript utility library for performing operations on all data types and data structures.

163 lines (128 loc) 3.19 kB
## utilict utilict provides utility functions and classes to make the job easy for different operations. [![Version](https://img.shields.io/npm/v/utilict)](https://www.npmjs.com/package/utilict) [![Downloads](https://img.shields.io/npm/dm/utilict)](https://www.npmjs.com/package/utilict) ## Installation Using npm: ```bash npm i utilict ``` ## Usage You can directly use these functions from the utilict library. ```js copy import { reverseNumber } from "utilict"; const number = 5698; reverseNumber(number); // Returns the result 8965 ``` Currently `number`, `string` and `array` data types are supported. Operations supported on the data types are: ### Number - Reverse Number - Prime Number - Palindrome Number - Factorial - Permutations - Combinations - Change Base - Distance Between Two Points ### String - Reverse String - Palindrome String - Get Words - String Count - Capitalize - Title Case - Anagram Strings ### Array - Minimum Array - Maximum Array - Array Product - Rotate Array - Mean - Median - Mode - Root Mean Square - Variance - Standard Deviation - Remove Duplicates - Histogram - Greatest Common Divisor (GCD) - Least Common Multiple (LCM) - Array Trim ### Matrix - Matrix Addition - Matrix Subtraction - Matrix Multiplication - Scalar Multiplication - Matrix Transpose - Matrix Determinant - Matrix Adjoint - Matrix Inverse - Matrix Flatten Also, `stack`, `queue` and `linked list` data structures are currently supported with following operations: ### Stack - Push - Pop - Peek - isFull - isEmpty - Length - Search ### Queue - Enqueue - Dequeue - isFull - isEmpty - Get Front - Get Rear - Length - Search ### Linked List - Create Linked List Using Array List - Reverse List - Find List Length - Add Node to the First of the List - Add Node to the Last of the List - Add Node to the given index in the List - Remove Node from the First of the List - Remove Node from the Last of the List - Remove Node from the given index in the List - Get node value of the given index in the List - Update node value of the given index in the List - Get middle node and node value of the List - Rotate the List to the Left - Rotate the List to the Right - Concat the given List with the another List - Print the node values of the List ### Binary Tree - Create Binary Tree Using Root Value - Get Root Node - Set Root Node - Insert New Node at the given path - Update A Node with the New Value - Delete A Node from the Given Path - Inorder Traversal - Preorder Traversal - Postorder Traversal - Level Order Traversal - Get height of the Binary Tree - Get height of the given node - Invert the Tree (Mirror Image) ### Binary Search Tree - Create Binary Search Tree Using Array List - Get Root Node - Insert New Node in the Binary Search Tree - Inorder Traversal - Preorder Traversal - Postorder Traversal - Level Order Traversal - Get height of the Binary Search Tree - Get height of the given node ### Complex Number - Add - Subtract - Multiply - Divide ### Utility Functions - Clone (deep cloning) - Compare (compare numbers, string, arrays, objects) You can check the whole documentation [here](https://utilict-docs.vercel.app/ "utilict library").