# fast-deep-copy

> 20 lines code! Deep copy the given object considering circular structure

Latest version **1.0.1** (published 2024-10-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install fast-deep-copy
pnpm add fast-deep-copy
yarn add fast-deep-copy
bun add fast-deep-copy
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2024-10-19 |
| First published | 2017-09-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | 625335512@qq.com |
| Maintainers | 625335512 |
| Keywords | fast-deep-copy, deep-copy, deepcopy |

## Links

- npm: https://www.npmjs.com/package/fast-deep-copy
- Repository: https://github.com/zhaolihang/fast-deep-copy
- Issues: https://github.com/zhaolihang/fast-deep-copy/issues
- npm.io page: https://npm.io/package/fast-deep-copy

## Recent versions

- 1.0.1 (latest) — 2024-10-19
- 1.0.0 — 2017-09-23

## README

#   fast-deep-copy 
    Only 20 lines code! no deps!
    It can correctly handle circular references!

##  Useage:
```
    npm install -S fast-deep-copy
```

```js

    import { deepCopy } from 'fast-deep-copy'

    let a = { dataA: 10, b: null };
    let b = { dataB: 20, a: null };
    a.b = b;
    b.a = a;

    let newA = deepCopy(a);
    console.log(newA.dataA === 10);     //true
    console.log(newA.b.dataB === 20);   //true
    console.log(newA.b.a === newA);     //true
```

---
_Source: https://npm.io/package/fast-deep-copy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
