finds.dev← search

// the find

lukeed/klona

★ 1,730 · JavaScript · MIT · updated Apr 2026

A tiny (240B to 501B) and fast utility to "deep clone" Objects, Arrays, Dates, RegExps, and more!

klona is a deep clone utility for JavaScript that ships four graduated entry points (json, lite, default, full) so you only pay for what you need — the smallest is 240 bytes gzipped. It's for frontend or Node projects where structuredClone isn't available or where you want predictable handling of Maps, Sets, TypedArrays, and custom class instances without pulling in lodash.

The tiered import design is genuinely smart: if you only have JSON-safe data, import klona/json and get 334k ops/sec; if you need Symbol and non-enumerable properties, pay the extra ~260 bytes for klona/full. Benchmark results are honest — validation failures for competitors (lodash drops Buffer and Map keys, clone drops DataView) are called out explicitly rather than hidden. Load time is sub-millisecond vs lodash's 29ms, which matters in SSR or cold-start contexts. Test coverage is thorough — separate suites per type including prototype pollution checks.

structuredClone shipped in Node 17 and all modern browsers, which handles most of these cases natively with no dependency cost at all — klona's value proposition has narrowed significantly since 2021. Benchmarks are pinned to Node 12.18.3, which is years out of date; V8 has changed enough that the numbers are not trustworthy today. Functions are deliberately not cloned (they're shared by reference), which is documented but will surprise anyone cloning objects that hold callbacks. Last meaningful code change appears to predate the structuredClone baseline shift — there's no guidance in the README on when you should still prefer klona over the platform built-in.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →