SuperUtilsPlus A superior alternative to Lodash with improved performance, TypeScript support, and developer experience. Features - Full Ty…
SuperUtilsPlus A superior alternative to Lodash with improved performance, TypeScript support, and developer experience. Features - Full Ty…
A superior alternative to Lodash with improved performance, TypeScript support, and developer experience.
npm install super-utils-plus
# or
yarn add super-utils-plus
# or
pnpm add super-utils-plus…import { get, deepClone } from 'super-utils-plus';
// Get a value from an object with a path
const object = { 'a': [{ 'b': { 'c': 3 } }] };
get(object, 'a[0].b.c');
// => 3
get(object, ['a', '0', 'b', 'c']);
// => 3
get(object, 'a.b.c', 'default');
// => 'default'
// Create a deep clone of an object
const original = { a: 1, b: { c: 2 } };
const clone = deepClone(original);
original.b.c = 99;
// clone.b.c is still 2import { camelCase } from 'super-utils-plus';
// Convert a string to camel case
camelCase('Foo Bar');
// => 'fooBar'
camelCase('--foo-bar--');
// => 'fooBar'
camelCase('__FOO_BAR__');
// => 'fooBar'import { debounce } from 'super-utils-plus';
// Create a debounced function
const debouncedSave = debounce(saveFunction, 300, { leading: true, trailing: true });
// Call it multiple times, but it will only execute once after 300ms of inactivity
debouncedSave();
debouncedSave();
debouncedSave();
// Cancel the debounced function
debouncedSave.cancel();
// Immediately invoke the debounced function
debouncedSave.flush();…import { clamp } from 'super-utils-plus';
// Constrain a number to an inclusive range
clamp(-10, -5, 5); // => -5
clamp(10, -5, 5); // => 5
clamp(3, -5, 5); // => 3import { random, randomInt, randomString, randomUUID } from 'super-utils-plus';
// Generate a random number between min and max
random(1, 10); // => 4.237...
// Generate a random integer between min and max (inclusive)
randomInt(1, 10); // => 7
// Generate a random string
randomString(10); // => "a1b2c3d4e5"
randomString(5, 'ABC'); // => "BACAB"
// Generate a random UUID
randomUUID(); // => "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed"For optimal bundle size, import only what you need:
// Import only what you need from specific modules
import { chunk, difference } from 'super-utils-plus/array';
import { get } from 'super-utils-plus/object';
import { debounce } from 'super-utils-plus/function';
import { isArray } from 'super-utils-plus/utils';SuperUtilsPlus is written in TypeScript and provides full type definitions:
import { get } from 'super-utils-plus';
interface User {
name: string;
profile: {
age: number;
email: string;
};
}
// Type-safe access with generics
const user = get(data, 'users[0]');MIT
No open issues yet, or sync has not completed.