Tired of bloated utility libraries slowing you down? xdash is the antidote. We provide a meticulously crafted suite of highly performant, modular, and strongly-typed utilities specifically designed for the modern TypeScript developer. Stop fighting your tools and start building amazing things, faster.
xdash
isn't just another utility library. It's a philosophy focused on developer efficiency and application performance:
- Laser-Focused Modularity: 📦 Import only the functions you need. Keep your application lean and fast.
- Aggressive Tree-Shaking: 🌳 Seamless integration with modern build tools like Vite, esbuild, and Webpack ensures minimal bundle size. No dead code, guaranteed.
- Blazing Performance: ⚡ Every function is optimized for speed. We benchmark rigorously so you don't have to worry about bottlenecks.
- Rock-Solid Typing: 🔒 Leverage the full power of TypeScript. Our strong types and type guards catch errors at compile time, not runtime, saving you precious debugging hours.
- Zero Runtime Dependencies: 🚫 Absolutely no baggage.
xdash
adds only the code you use. - Modern Tooling: ✨ Built with Bun, tested with Jest, documented with VitePress & TypeDoc. We embrace the best of the modern web ecosystem.
- Essential Utilities: A curated collection covering arrays, objects, strings, async operations, type checking, and more.
- Functional Programming Inspired: Clean, predictable, and composable functions.
- Chainable Interface: An optional, expressive way to link operations (
x.chain(...)
). - Inline Switch: A powerful alternative to traditional switch statements (
x.InlineSwitch(...)
). - Comprehensive Testing: High test coverage ensures reliability and stability.
- Crystal-Clear Documentation: Easily searchable and navigable docs generated via VitePress.
Integrate xdash
into your project in seconds:
npm install xdash
# or
yarn add xdash
# or
pnpm add xdash
# or
bun install xdash
import { isStr, capitalize } from 'xdash';
// Or import the whole library
// import * as x from 'xdash';
let greeting = "hello, world!";
if (isStr(greeting)) {
// capitalize is type-safe thanks to isStr!
console.log(capitalize(greeting)); // Outputs: "Hello, world!"
}
// Chain example
const result = x.chain([1, 2, 3])
.map(n => n * 2)
.filter(n => n > 3)
.sum() // Assuming sum is added or available
.value(); // result = 10 (4 + 6)
console.log(result);
➡️ Explore the Full Documentation to discover all available utilities. (Note: Link points to GitHub Pages, deployment pending CI setup)
Got an idea or found a bug? We welcome contributions! Help us make xdash
even better. Please read our contribution guidelines (TODO: Create this file) to get started.
If xdash
helps you build faster or saves you time, consider supporting its development:
xdash
is open-source software licensed under the MIT License.