Registry / serialization / moderndash

moderndash

JSON →
library4.0.2jsnpmunverified

ModernDash is a TypeScript-first utility library designed as a performant and lightweight alternative to Lodash, optimized for modern browsers and enhanced developer experience. Currently stable at version 4.0.2, it follows a release cadence driven by feature additions, bug fixes, and security patches, with major versions tied to breaking changes like Node.js version bumps. Key differentiators include its strict TypeScript adherence (no `any` types), ESM-only distribution, tree-shakable design, and a strong focus on outperforming Lodash in most benchmarks while maintaining zero runtime dependencies. It selectively implements only essential utility functions, encouraging the use of native JavaScript alternatives where available, contrasting with Lodash's more comprehensive API surface.

npm install moderndash
INSTALL
IMPORT
SIG · MODERNDASH
M
moderndash
serializationjavascriptv4.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

chunk
import { chunk } from 'moderndash'
const chunk = require('moderndash').chunk
ModernDash is ESM-only since v3; CommonJS require statements will fail.
camelCase
import { camelCase } from 'moderndash'
const camelCase = require('moderndash').camelCase
Ensure your project is configured for ESM. For TypeScript, set `"module": "esnext"` or similar in `tsconfig.json`.
merge
import { merge } from 'moderndash'
const merge = require('moderndash').merge
Named imports are the standard pattern. There is no default export.

This quickstart demonstrates how to install ModernDash and use fundamental utility functions like `chunk`, `camelCase`, and `merge` in a TypeScript environment.

import { chunk, camelCase, merge } from 'moderndash'; console.log('--- moderndash Quickstart ---'); // Example 1: Chunk an array into smaller arrays const myArray = [1, 2, 3, 4, 5, 6, 7]; const chunkedArray = chunk(myArray, 3); console.log('Chunked array:', chunkedArray); // Expected: [[1, 2, 3], [4, 5, 6], [7]] // Example 2: Convert a string to camel case const myString = 'hello world moderndash example'; const camelCasedString = camelCase(myString); console.log('Camel cased string:', camelCasedString); // Expected: "helloWorldModerndashExample" // Example 3: Deep merge objects const object1 = { 'a': [{ 'b': 2 }, { 'd': 4 }] }; const object2 = { 'a': [{ 'c': 3 }, { 'e': 5 }] }; const mergedObject = merge(object1, object2); console.log('Merged object:', JSON.stringify(mergedObject, null, 2)); /* Expected (keys merged by index in arrays): { "a": [ { "b": 2, "c": 3 }, { "d": 4, "e": 5 } ] }*/
Debug
Known issues
breakingModernDash v4.0.0 and later require Node.js version 20.x or higher. Projects running on older Node.js versions will encounter errors.
fix
Upgrade your Node.js environment to version 20.x or newer. Alternatively, pin your `moderndash` dependency to `<4.0.0`.
affects: >=4.0.0
breakingFunctions `merge` and `set` in versions prior to v4.0.1 were vulnerable to prototype pollution. This could allow attackers to inject arbitrary properties into `Object.prototype`, potentially leading to denial-of-service or remote code execution.
fix
Upgrade to `moderndash@4.0.1` or newer immediately to mitigate prototype pollution vulnerabilities. Review your application for any sensitive operations involving `merge` or `set`.
affects: <4.0.1
deprecatedSeveral utility functions including `difference`, `intersection`, `isUrl`, and `groupBy` have been deprecated in favor of native JavaScript APIs (e.g., `Set.prototype.intersection()`, `URL.canParse`, `Object.groupBy`).
fix
Migrate deprecated function calls to their native JavaScript equivalents. The library prioritizes minimal API surface and encourages native solutions where available.
affects: >=3.11.0
gotchaThe `deburr` function prior to v4.0.2 incorrectly handled certain ligatures and special Latin characters (e.g., æ, œ, ß, ø), passing them through unchanged instead of decomposing them. This could result in unexpected string normalization behavior.
fix
Upgrade to `moderndash@4.0.2` or newer to ensure correct and comprehensive deburring of a wider range of special characters.
affects: <4.0.2
Errors
Common errors & fixes
SyntaxError: Named export 'chunk' not found. The requested module 'moderndash' does not provide an export named 'chunk'
Attempting to import ModernDash functions using CommonJS `require()` syntax in an ESM-only environment.
fix
Refactor your import statements to use ES Module syntax: `import { chunk } from 'moderndash';` and ensure your project is configured for ESM.
Error: The 'moderndash' package requires Node.js version >=20.x. You are running Node.js version X.
Using ModernDash v4.x or later with an unsupported Node.js version.
fix
Update your Node.js environment to version 20 or higher. You can use a tool like `nvm` to manage Node.js versions.
TypeError: (0 , _moderndash.merge) is not a function
A bundler or transpiler might be incorrectly transforming ESM imports to CommonJS, or a CommonJS context is trying to use an ESM-only library.
fix
Ensure your build setup (e.g., Babel, Webpack, Vite) is correctly configured for ES Modules, allowing `import` statements to resolve `moderndash` properly. Verify `"type": "module"` in your `package.json` if running in Node.js, or adjust bundler configurations.
Upgrade
Version history
4.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
moderndash — npm install moderndash · libregistry