{"id":17705042,"url":"https://github.com/alessiogr/fastest-deep-clone-json","last_synced_at":"2026-02-25T06:03:51.393Z","repository":{"id":249613890,"uuid":"832034685","full_name":"AlessioGr/fastest-deep-clone-json","owner":"AlessioGr","description":"Fastest way to deep-clone JSON objects","archived":false,"fork":false,"pushed_at":"2024-07-22T14:17:16.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T08:37:09.951Z","etag":null,"topics":["clone-deep","copy","deep-clone","deep-copy","deepclone","javascript","json","node","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlessioGr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-22T08:16:09.000Z","updated_at":"2024-07-22T14:17:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b95ed0a-c1e5-4357-8350-7c5310cd7c07","html_url":"https://github.com/AlessioGr/fastest-deep-clone-json","commit_stats":null,"previous_names":["alessiogr/fastest-deep-clone-json"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioGr%2Ffastest-deep-clone-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioGr%2Ffastest-deep-clone-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioGr%2Ffastest-deep-clone-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioGr%2Ffastest-deep-clone-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlessioGr","download_url":"https://codeload.github.com/AlessioGr/fastest-deep-clone-json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244693265,"owners_count":20494453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clone-deep","copy","deep-clone","deep-copy","deepclone","javascript","json","node","nodejs","typescript"],"created_at":"2024-10-24T22:06:01.893Z","updated_at":"2025-10-26T18:31:47.739Z","avatar_url":"https://github.com/AlessioGr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is the fastest deep-clone implementation for JSON objects - faster than `structuredClone`, `JSON.parse(JSON.stringify(obj))` and other implementations, according to www.measurethat.net.\n\nThis package is ESM-only.\n\n- **Dependencies**: 0\n- **Bundle size (minified and gzipped)**: 316 Bytes\n- **Module count**: 1\n\nIt avoids recursion in favor of a stack, in order to keep the memory usage low.\n\n## Performance comparison\n\n| Method                                                                                                            | Ops/sec   |\n|-------------------------------------------------------------------------------------------------------------------|-----------|\n| This package (iterative deep clone)                                                                               | 3.560.061 |\n| recursive deep clone                                                                                              | 3.476.448 |\n| [fastest-json-copy v2](https://github.com/streamich/fastest-json-copy/blob/main/lib/v2.js)                        | 1.523.427 |\n| JSON.stringify                                                                                                    | 1.465.516 |\n| [fastest-json-copy v1](https://github.com/streamich/fastest-json-copy/blob/main/lib/v1.js)                        | 1.320.249 |\n| [jsondiffpatch.clone](https://github.com/benjamine/jsondiffpatch/blob/master/packages/jsondiffpatch/src/clone.ts) | 1.245.459 |\n| structuredClone                                                                                                   | 789.100   |\n\nRun it yourself: https://www.measurethat.net/Benchmarks/ShowResult/534839 (this package is `deepCopyObjectIterative` in that comparison).\n\nWhen running the local benchmark, the results are very different and [jsondiffpatch.clone](https://github.com/benjamine/jsondiffpatch/blob/master/packages/jsondiffpatch/src/clone.ts) becomes the fastest.\n\n## Installation\n\n```bash\npnpm install fastest-deep-clone-json\n```\nor\n\n```bash\nnpm install fastest-deep-clone-json\n```\n\n## Usage\n\n```ts\nimport { deepCloneJson } from 'fastest-deep-clone-json';\n\nconst obj = { a: 1, b: { c: 2 } };\n\nconst cloned = deepCloneJson(obj);\n\nconsole.log(cloned); // { a: 1, b: { c: 2 } }\n```\n\nThis library will only work with JSON-serialized objects. It does not handle data types like `Date`, `Map`, `Set`, `BigInt`, `Symbol`, `Function` etc etc. The goal is to provide the fastest deep-clone implementation for JSON objects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessiogr%2Ffastest-deep-clone-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falessiogr%2Ffastest-deep-clone-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessiogr%2Ffastest-deep-clone-json/lists"}