utilityx v1.1.6
❗❕ What is this? ❕❗
UtilityX makes JavaScript easier by taking the hassle out of working with arrays, numbers, objects, strings, etc. UtilityX’s modular methods are great for:
- Iterating arrays, objects, & strings.. :heart_eyes:
- Manipulating & testing values.. :smirk:
- Creating composite functions.. :sunglasses:
- And many more cool things! :wink:
Check out our WIKI for more info!!
A letter of Appreciation ❣
A huuugeee Thanks to Dark-error-Honor for helping me create UtilityX!
How can I use this? 🤔
> npm i utilityx
> const x = require("utilityx");
// parameters: (string)
x.removeVowels("utilityx");
// => "tltyx"
// parameters: (string)
x.spaceCount("utilityx is a util lib.");
// => 4
// parameters: (number)
x.isInt(1);
// => true
// parameters: (number)
x.isFloat(1.1);
// => true
// parameters: (array)
x.isArray(["Hello", "World", "!"]);
// => true
// parameters: (array)
x.removeDuplicates([1, 2, 3, 4, 2, 3]);
// => [1, 2, 3, 4]
// parameters: (array)
x.compact([null, "", undefined, 0, 5, "hello"]);
// => [5, 'hello']
// parameters: (array)
x.lastIndex([1, 2, 3, 4, "Hi"]);
// => 'Hi'
// parameters: (array, depth to flatten(Number))
x.flatten([1, [2, [3, [4, [5]]]]]);
// => [1, 2, 3, 4, 5]
// parameters: (array, index(negative or positive Number))
x.nth(["first", "second", "third"], -2);
// => 'second'
// parameters: (array, values to pull out)
x.pull([1, 2, 3, "hello", 4], 1, "hello");
// => [1, 2, 3, 4]
// parameters: (array)
x.head([1, 2, 3, 4, 5]);
// => [1, 2, 3, 4]
// parameters: (array)
x.removeDuplicates([1, 2, 3, 4, 5]);
// => [2, 3, 4, 5]
// parameters: (array, array, array, ...)
x.union([1, 2, 3, 4, 5], [1, 2], [3, 6]);
// => [1, 2, 3, 4, 5, 6]
// parameters: (array, array, array, ...)
x.sortedUnion([5, 2, 4], [6, 4, 9]);
// => [2, 4, 5, 6, 9]
// parameters: (array)
arr = [1, 2, 3];
x.deepCopy(arr);
// => [1, 2, 3]
// parameters: (lower bound, number, upper bound)
x.clamp([2, 5, 8]);
// => 5
x.clamp([8, 2, 10]);
// => 8
x.clamp([2, 10, 5]);
// => 5
// parameters: (Number)
x.range(5);
// => [0, 1, 2, 3, 4]
// parameters: (String)
x.camelCase("caMel caSe");
// => 'camelCase'
// parameters: (String)
x.pascalCase("paScAl caSe");
// => 'PascalCase'
// parameters: (String)
x.snakeCase("snAke caSe");
// => 'sn_ake_cas_e'
x.snakeCase("snake case");
// => 'snake_case'
// parameters: (String)
x.kebabCase("keBab caSe");
// => 'ke-bab-ca-se'
x.kebabCase("kebab case");
// => 'kebab-case'
// parameters: (String)
x.camelCase("caPs");
// => 'CaPs'
Why use UtilityX? 🚀
UtilityX helps programmers write more concise and easier to maintain JavaScript code. UtilityX contains tools to simplify programming with strings, numbers, arrays, functions and obfljects. By convention, UtilityX module is mapped to the x character.
Is it tested? 🧪
Tested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.
How can I contribute? 🎉
Please read this document before contributing to UtilityX! All bug fixes, improvements are appreciated ♥
Did you find an issue? ⚠️
Please read this document.
What about the license? 📃
UtilityX is released under the MIT license & supports modern environments.
> Thank you for reading this to the end! 😎