# nanoclone

> 300B to deep clone JavaScript objects

Latest version **1.0.2** (published 2023-05-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install nanoclone
pnpm add nanoclone
yarn add nanoclone
bun add nanoclone
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-05-11 |
| First published | 2017-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 71 |
| Author | Anton Kosykh |
| Maintainers | kelin2025 |
| Keywords | clone, deep, nano, nanoclone, deepclone |

## Links

- npm: https://www.npmjs.com/package/nanoclone
- Repository: https://github.com/kelin2025/nanoclone
- Homepage: https://github.com/kelin2025/nanoclone#readme
- Issues: https://github.com/kelin2025/nanoclone/issues
- npm.io page: https://npm.io/package/nanoclone

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-05-11
- 1.0.1 — 2022-10-31
- 1.0.0 — 2021-10-29
- 0.2.1 — 2018-02-19
- 0.2.0 — 2018-01-23
- 0.1.5 — 2018-01-05
- 0.1.4 — 2018-01-05
- 0.1.3 — 2017-12-31
- 0.1.2 — 2017-11-24
- 0.1.1 — 2017-11-24
- 0.1.0 — 2017-11-24

## README

# nanoclone
[![license](https://img.shields.io/github/license/kelin2025/nanoclone.svg)](https://github.com/kelin2025/nanoclone/blob/master/LICENSE)
[![npm](https://img.shields.io/npm/v/nanoclone.svg)](https://npmjs.com/package/nanoclone)  
Only **300B** to deep clone JavaScript objects

## Is it small enough?
See the size of the most popular **[clone](https://www.npmjs.com/package/clone)** npm package with **250M+** downloads
![image](https://user-images.githubusercontent.com/4208480/34631395-30df289c-f281-11e7-8442-01502af2097a.png)  
And nanoclone size:  
![image](https://user-images.githubusercontent.com/4208480/35292759-9c839f06-0082-11e8-9196-d710d530a74b.png)

## Supported 
- [x] Primitives
- [x] Arrays
- [x] Plain objects
- [x] DOM Nodes
- [x] Date instances
- [x] RegExp instances
- [x] Maps
- [x] Sets
- [x] Circular structures

## Installation
```
yarn add nanoclone
npm install nanoclone
```

## Usage
```javascript
import clone from 'nanoclone'

let a = {
  num: 2,
  arr: [1, 2, 3],
  nested: {
    obj: {
      a: 0
    }
  }
}

let b = clone(a)
```

## License
MIT

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