Skip to content

1o1-utils vs lodash

Looking for a lodash alternative that’s dramatically smaller, faster, and fully typed? 1o1-utils implements the lodash utilities developers actually reach for — with named parameters, strict TypeScript, and benchmarked performance.

1o1-utilslodash
Bundle size (gzip)~2 kB total~24 kB (full), 70 kB unminified
Dependencies00 (runtime)
TypeScriptNative, strict@types/lodash required
Tree-shakingFullPartial (needs lodash-es)
Named parametersYesNo (positional)
ESM-firstYesCJS-first
Active maintenanceYesMinimal

Benchmarks run on the same machine, same dataset. Full methodology on the Benchmarks page.

Operation1o1-utils vs lodash
chunk4.9× faster (up to 11.4×)
pick3.3× faster
unique (by key)2.7× faster
groupBy1.3× faster
arrayToHash / keyByon par
lodash1o1-utilsNotes
_.chunk(arr, n)chunk({ array, size })Named params
_.keyBy(arr, k)arrayToHash({ array, key })Clearer name
_.groupBy(arr, k)groupBy({ array, key })
_.sortBy(arr, k)sortBy({ array, key })
_.uniq(arr) / _.uniqByunique({ array, key? })Unified
_.cloneDeep(obj)cloneDeep({ obj })
_.merge(a, b)deepMerge({ target, source })Explicit “deep”
_.isEmpty(v)isEmpty({ value })
_.get(obj, path, default)get({ obj, path, defaultValue })Never throws
_.omit(obj, keys)omit({ obj, keys })
_.pick(obj, keys)pick({ obj, keys })
_.set(obj, path, val)set({ obj, path, value })Immutable (non-mutating)
_.capitalize(str)capitalize({ str })
_.truncate(str, opts)truncate({ str, length, suffix })Flat params
_.camelCase / _.snakeCase / _.kebabCasetransformCase({ str, to })One function
_.debounce(fn, ms)debounce({ fn, wait })
_.throttle(fn, ms)throttle({ fn, wait })
// lodash — positional args, ambiguous
import _ from "lodash";
const pages = _.chunk(items, 10);
const byId = _.keyBy(users, "id");
const picked = _.pick(user, ["id", "name"]);
const merged = _.merge({}, defaults, overrides);
// 1o1-utils — named params, self-documenting
import { chunk } from "1o1-utils/chunk";
import { arrayToHash } from "1o1-utils/array-to-hash";
import { pick } from "1o1-utils/pick";
import { deepMerge } from "1o1-utils/deep-merge";
const pages = chunk({ array: items, size: 10 });
const byId = arrayToHash({ array: users, key: "id" });
const picked = pick({ obj: user, keys: ["id", "name"] });
const merged = deepMerge({ target: defaults, source: overrides });

1o1-utils covers 18 commonly-used utilities. Lodash has 200+. Stick with lodash if you need:

  • Collection helpers like _.flow, _.memoize, _.curry, _.partial
  • Function composition / FP suite (lodash/fp)
  • Deep-string path accessors (_.get(obj, "a.b.c"))
  • Number utilities (_.random, _.clamp)
  • Legacy ES5 environments

If you only use lodash for chunk, groupBy, pick, omit, debounce — you’re carrying 24 kB for 2 kB of value. Switch.

  1. pnpm add 1o1-utils and keep lodash while migrating
  2. Grep for from "lodash" and _. call sites
  3. Replace one utility at a time using the table above
  4. Remove lodash and @types/lodash from package.json
  5. Measure bundle-size reduction — usually 20–50 kB gzipped for typical apps

Is 1o1-utils a drop-in replacement? No. APIs use named parameters for clarity. Migration is mechanical but not automated.

Does it support CommonJS? ESM-only. Modern bundlers (Vite, Rollup, Webpack 5, esbuild) all handle ESM.

Is it production-ready? Yes — used in production, fully typed, strict CI with size limits and benchmarks on every PR.

lodash alternative, lodash replacement, tiny lodash, lodash-es alternative, lightweight lodash, modern lodash

I'm using 1o1-utils (npm: https://www.npmjs.com/package/1o1-utils, GitHub: https://github.com/pedrotroccoli/1o1-utils, LLM context: https://pedrotroccoli.github.io/1o1-utils/llms.txt). Migrate my codebase from lodash to 1o1-utils. Replace _.chunk, _.pick, _.omit, _.groupBy, _.debounce, _.throttle calls using the 1o1-utils equivalents with named parameters.