Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

radashi

radashi-org140.6kMIT12.6.2TypeScript support: included

The modern, community-first TypeScript toolkit with all of the fast, readable, and minimal utility functions you need. Type-safe, dependency-free, tree-shakeable, fully tested.

readme

Radashi

Radashi

License Build Status Codecov Code Style: Biome.js GitHub Discussions JSR.io

English | Português

Ditch the bloat of Lodash. Stop reinventing the wheel.

Radashi (pronounced /ruh-DAH-shee/) is a TypeScript utility toolkit, packed with lightweight functions that are readable, performant, and robust.

Radashi is an actively maintained fork of Radash, the fastest growing Lodash alternative with 100K+ weekly downloads.

“What makes Radashi so great?”

  • unique and well-designed functions
  • tree-shakeable (use only what you need!)
  • dependency-free
  • community-first (your opinions matter)
  • future-proof (written with modern ES6+ syntax)
  • actively maintained (with a growing team of passionate maintainers)
  • type-safe (the best type definitions possible)
  • full test coverage
  • performance tracking (we track perf regressions with continuous benchmarking)
  • well-documented
  • nightly releases (radashi@beta)
  • changelog (easily see what's new in each release)

If you've been using Radash (our predecessor), you're probably interested in what makes us different. Read our comparison post to learn how we're bringing Radash to the next level while preserving its best features.

Radash documentation

Install

pnpm add radashi
yarn add radashi
npm install radashi

Beta versions

Beta versions are published regularly with new functions and improvements. They never contain breaking changes (see the Breaking changes section). The beta branch contains the source code for beta versions.

To get notified of a new beta version, watch the radashi-canary repository. You can find release notes for beta versions here.

The latest beta version can be installed with:

pnpm add radashi@beta -E

The -E flag ensures that the beta version is installed as an exact version (e.g. `radashi@12.3.0-beta.abc1234`). This is recommended to avoid accidental breakage.

Breaking changes

Preview releases for the next major version are also announced in the radashi-canary repository. The next branch contains the source code for the next major version.

We'd appreciate your help testing the latest next version before it's released:

pnpm add radashi@next -E

JSR.io

Radashi is also published to the JSR registry, which gives Radashi its own page.

jsr add @radashi-org/radashi
deno add jsr:@radashi-org/radashi

FAQ

  • “I need XYZ, but Radashi doesn't have it.” If you have a need not met by our current set of functions, we want to hear about it. Start a discussion so we can explore the idea together!

  • What does “community first” mean exactly? It means putting the community's needs first, leaning towards adding support for popular use cases, as opposed to being strictly minimalist. As such, your feedback is very welcome and we value your perspective. Specifically, we want you to contribute your viewpoint to discussions in our RFCs category.

  • Are my contributions welcome? Yes! Pull requests are encouraged, but please keep them small and focused. Sweeping changes are discouraged and won't be merged (unless the rationale's been thoroughly discussed).

    Please review “The ethos of Radashi” before submitting a pull request:

    The ethos of Radashi
  • Can I help you maintain this? Yes! I'll add you as a contributor to the repository. You can review pull requests and help with triage. With time, you may earn the ability to merge approved PRs.

    Apply to join the Radashi team
  • Is backwards compatibility a goal? Yes! We want the transition from radash to this library to be smooth. If you're coming from Radash, we recommend installing radashi@^12. This version will continue to receive backported fixes even after Radashi v13 is released. You can upgrade to the latest major version when you're ready.

  • Automatic releases To ensure contributions are quickly rolled out, we have the following automatic processes:

    • Patch releases Whenever the main branch receives a ^fix: commit, a patch release is immediately published to NPM.

    • Beta releases Pull requests that add a new feature can be labeled with prerelease by a maintainer. This triggers a GitHub workflow that attempts to copy the PR into the beta branch. If that succeeds, a beta release is immediately published to NPM.

      Installing radashi@beta will always fetch the latest beta release. Although the name "beta" may suggest unstable code, PRs need tests to be eligible for a prerelease.

      Beta releases provide quick access to new features without waiting for a regular release cycle. They're also an opportunity for the community to provide feedback before the feature is released to the main branch.

    • "Next" releases Pull requests with breaking changes can also be labeled with prerelease by a maintainer. In this case, the PR is copied into the next branch. If that succeeds, a "next" release is published to NPM.

      Installing radashi@next will always fetch the latest "next" release.

  • Release cycle Radashi is expected to release a new minor or major version on a monthly basis, but releases are not on a strict schedule. Pre-releases are available for testing and feedback before the final release.

Contributing

Contributions are welcome and appreciated! Check out the contributing guide before you dive in:

Contributing to Radashi

 

Radashi

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

radashi@12.6.2 - 2025-08-20

Details

Fixed

  • (range) Ensure end parameter works when 0 in 9c8ffa0

radashi@12.6.1 - 2025-08-09

Details

Fixed

  • (group) Use Object.create(null) for the returned object in 5db8c37

radashi@12.6.0 - 2025-06-26

Details

Added

  • Add assert function in c318129
  • Add escapeHTML function in 9ad9c0b
  • Add queueByKey function in fb30703
  • Add Semaphore class in 5f733db
  • Add parseDuration and parseQuantity functions in 95e1336
  • Add promiseChain function in f64fa07

Changed

  • (group) Pass array index to callback in 6d66395

Fixed

  • (selectFirst) Filter out null from return type when no condition is given in 73cb995
  • (isIntString) Prevent incorrect type narrowing in fafd68a

radashi@12.5.1 - 2025-05-23

Details

Fixed

  • (set) Avoid mutating nested objects without first cloning them in fc3c7c9
  • (set) Prevent prototype pollution in 8147abc

radashi@12.5.0 - 2025-05-15

Details

Added

Changed

  • (cluster) Use tuple types for common size constants in ca2abdd

Fixed

  • (mapify) Pass the actual array index to callbacks in a83a72d
  • (cluster) Avoid infinite loop when size is 0 in 214ce5d

Types

  • Handle object types in CompatibleProperty in 7f72da3

radashi@12.4.0 - 2025-03-16

Details

Added

  • Add isBigInt function in 05ae69a
  • Add remove function in e29c59e
  • Add isAsyncIterable function in d3c69d7
  • Add memoLastCall function in 5848451
  • Add toResult function in 66299bd

Types

  • reduce accumulator type when no initial value is given in 7a14bf6

radashi@12.3.4 - 2025-01-26

Details

Fixed

  • (reduce) Align with native reduce behavior + perf improvements in 1bc47b7

radashi@12.3.3 - 2025-01-11

Details

Types

  • Let map callback return a PromiseLike object in 1c679b3

radashi@12.3.2 - 2025-01-10

Details

Fixed

  • (shuffle) Correction to Fisher-Yates implementation in 5df2dc8

radashi@12.3.1 - 2025-01-07

Details

Fixed

  • (parallel) Avoid range error with empty array in f16445d

radashi@12.3.0 - 2024-12-01

Details

Security

Added

  • Add signal option to retry and parallel in 73a4e90
  • Add isClass function in 2d1b3b2
  • Add isNullish function in 7470f9d
  • Add cartesianProduct function in 84dd509
  • Add isUndefined function in d527d98
  • Add timeout function in 6a0ba7e
  • Add dedent function in 14132e5

Changed

  • (parallel) Clamp the limit between 1 and array length in b4854f6

radashi@12.2.3 - 2024-11-12

Details

Fixed

  • (all) Be more lenient, reduce memory usage in e6accd8

radashi@12.2.2 - 2024-11-10

Details

Types

  • Export PromiseWithResolvers type in a2a5da1
  • Improve isEmpty signature in b95cb73
  • Narrow return type of first and last in 665ba72
  • Improve draw signature for non-empty arrays in fee290a

radashi@12.2.1 - 2024-11-09

Details

Types

  • Improve signature of shake in 8fe71d8
  • mapValues index signature handling in 2ade9be
  • Let zipToObject receive readonly arrays in 2c68597

radashi@12.2.0 - 2024-11-01

Details

Added

  • Add isIntString function in fa500d3
  • Add isPlainObject type guard in ddae618
  • Add round function in eadf5d0
  • Add mapify function in b82b292
  • Add unzip function in dc0a546
  • Add flip function in 66a71b0
  • Add once function in 3401240
  • Add lerp function in 072778f
  • Add isMap function in 4f2e48c
  • Add isRegExp function in 58e7d96
  • Add isSet function in 73e70c1
  • Add isWeakSet function in aacd5be
  • Add isWeakMap function in f32cfd5
  • Add traverse function in 2231c0e
  • Add cloneDeep function in 46ee7c7
  • Add castMapping function in 27382bb
  • Add clamp function in 7f4a449
  • Add castArray and castArrayIfExists in 8758ed7
  • Add castComparator function in ddc114c
  • Add reverse argument to castComparator in 1d7937e
  • Add isBoolean function in adc419d
  • Add noop and always functions in eb77c8f
  • Add similarity function in dac01cc
  • (throttle) Add trailing option in 0480a16
  • (throttle) Add trigger method to ThrottleFunction in ac3f6d9
  • Add withResolvers ponyfill in 79f1ac7
  • (debounce) Add leading option in 942057e
  • Add isResult, isResultOk, and isResultErr functions in 08d4329
  • Add isError function in c772099

Changed

  • (intersects) Let identity callback return any value in 49a0dc4
  • (unique) Let toKey return any kind of value in 3fd8446
  • (select) Let condition be undefined in dc74ace
  • Replace matchKeys with filterKey in 3652c3e
  • (filterKey) Accept null/undefined filter in b10ad10
  • Add selectFirst in f792633
  • (pick) Accept a callback for advanced picking in b9dc648
  • (mapify) Provide an index argument to the callbacks in f010ad4
  • Use native AggregateError if available in 5668b85

Fixed

  • (retry) Stop using range() in 5d60893
  • (assign) Remove inefficiencies in loop in 99274cc
  • (set) Avoid false positive of array index in path in ff0c3cf
  • (shake) Stop using Omit on return type and give filter parameter a safer type in e6f75aa
  • (series) Allow items param to be a readonly array in 5114eb2
  • Copy is-plain-obj implementation in 08a18e2
  • Avoid isObject for internal use in 3b6a67c
  • (isArray) Work with readonly T[] types in 88c12b6
  • (keys) Improve perf by avoiding excessive array allocations in f0e06ba
  • Ensure mapValues and group work together in 630f9ef
  • Use typeof in isFunction in 6ad96f4
  • toInt and toFloat should not throw on symbols in cafc7fc
  • (toggle) Handle falsy input as expected in 547c6f3
  • (assign) Fix overriding a nested object with null in 30c42e9
  • (crush) Fix handling of period-containing property names in a5e5180
  • (toggle) Use -1 as index for toKey() with toggled item in 10ee12d
  • (pascal) Handle camel-cased strings correctly in a1c8822

Performance

  • Avoid excessive array allocation in fork in 88807cc
  • Make template faster in 8e4eb5e
  • (series) Avoid object spread in loop in d3b6331
  • (cluster) Avoid an array allocation in 978789d
  • (replace) Avoid creating 2 intermediate arrays in 20daf2a
  • (merge) Avoid arrow function in loop and avoid calling user-provided key generator more than once per item in 1437d19
  • (replaceOrAppend) Avoid creating 2 intermediate arrays in 26ecbc7
  • (shuffle) Use the Fisher-Yates algorithm in 27b1710
  • (merge) Improved handling of large arrays in d8f7281

Types

  • Let filterKey accept key: keyof any in 73ac8bb
  • Add TryitResult<T> type in f044364
  • Add MemoOptions<T> type in 877a1e4
  • Export UppercaseKeys and LowercaseKeys types in 96b28b9
  • Let zip accept readonly arrays in f7d93cc
  • Improve the isArray return type for unknown input type in ef14440
  • select return type when no condition is defined in ab76d65
  • Add FilteredKeys type in 6a6f899
  • Improve the return type of filterKey in bc298c6
  • Handle tuples in isArray return type in 9257535
  • Make select more option-friendly in c9cfcd0
  • Let shift accept a readonly array type in 5e19d66
  • Remove type constraint for mapped array passed to sum in dea0f50
  • Make assign return type more accurate + add Assign type in f1e4957
  • Add Ok/Err/Result/ResultPromise types in f5db070
  • Align isPromise return type with its logic in d6e0dff
  • Publicize the Falsy type in 736d334
  • Avoid inferring memo return type from key option in 7b4656e
  • Allow readonly array in omit function in a88fa1b