Min-dash is a lean, battle-tested utility belt providing a curated selection of essential functions for JavaScript and TypeScript development, particularly within the bpmn.io ecosystem. It differentiates itself by its minimal bundle footprint (under 2 kB gzipped), ES2015 compatibility, and performance-optimized utilities for common operations like sorting and unions. The library ships with comprehensive TypeScript type definitions, ensuring a robust development experience. The current stable version is `5.0.0`, published in February 2024. The project maintains an active release cadence, addressing bug fixes and improvements in minor versions, with major releases introducing significant architectural shifts, such as the transition to an ESM-only distribution. It encourages the use of modern module bundlers for optimal tree-shaking.
npm install min-dashVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing and using `find`, `sortBy`, and `assign` utilities for common data manipulation tasks with an emphasis on ESM syntax.
Migrate your project to use ESM imports (`import ... from 'min-dash';`) and ensure your `package.json` has `"type": "module"` or files use `.mjs` extension. For CommonJS-only environments, use `min-dash@^4.0.0`.
Modern bundlers like Webpack, Rollup, or esbuild usually handle tree-shaking automatically for ESM imports. If using CommonJS, consider tools like `common-shake` (though not applicable for v5+).
Upgrade to `min-dash@^4.2.2` or newer to ensure robust handling of `undefined` inputs and correct type definitions across all utilities.
Switch to ESM `import` statements: `import { utility } from 'min-dash';`.Ensure your project is configured for ESM (`"type": "module"` in `package.json`) when using `min-dash@^5.0.0`. Alternatively, if you must use CommonJS, downgrade to `min-dash@^4.0.0`.
Always provide a valid object as the first argument to `assign` (e.g., `assign({}, source)`). Ensure inputs to other utilities are of the expected type, or add explicit checks (`if (input == null) return defaultValue;`) where necessary.No dependency data recorded yet.