Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
SuperUtilsPlus
A superior alternative to Lodash with improved performance, TypeScript support, and developer experience.
Features
- Full TypeScript Support: Type definitions are first-class citizens
- Modern JavaScript: Written for ES2020+ with full ESM and CommonJS support
- Tree-Shakable: Only import what you need
- Zero Dependencies: Lightweight and no bloat
- Extensive Testing: High test coverage for reliable code
- Extended Functionality: More utility functions than Lodash
- Performance Focused: Optimized for speed and efficiency
- Browser & Node.js: Works everywhere JavaScript runs
Installation
npm install super-utils-plus # or yarn add super-utils-plus # or pnpm add super-utils-plus
Usage Examples
Array Functions
Object Functions
String Functions
Function Utilities
import { debounce } from 'super-utils'; // 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();
Type Checking
Random Utilities
randomString(5, 'ABC'); // => "BACAB"
// Generate a random UUID
randomUUID(); // => "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed"
Tree-Shaking with Module Imports
For optimal bundle size, import only what you need:
// Import only what you need from specific modules import { chunk, difference } from 'super-utils/array'; import { get } from 'super-utils/object'; import { debounce } from 'super-utils/function'; import { isArray } from 'super-utils/utils';
TypeScript Support
SuperUtilsPlus is written in TypeScript and provides full type definitions:
