# just-clone

> deep copies objects and arrays

Latest version **6.2.0** (published 2022-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install just-clone
pnpm add just-clone
yarn add just-clone
bun add just-clone
```

## 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 | 6.2.0 |
| Published | 2022-12-17 |
| First published | 2017-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6189 |
| Author | Angus Croll |
| Maintainers | angus-c |
| Keywords | object, clone, copy, deep-copy, extend, no-dependencies, just |

## Links

- npm: https://www.npmjs.com/package/just-clone
- Repository: https://github.com/angus-c/just
- Homepage: https://github.com/angus-c/just#readme
- Issues: https://github.com/angus-c/just/issues
- npm.io page: https://npm.io/package/just-clone

## Recent versions

- 6.2.0 (latest) — 2022-12-17
- 6.1.1 — 2022-08-08
- 6.1.0 — 2022-08-07
- 6.0.1 — 2022-06-05
- 6.0.0 — 2022-06-04
- 5.1.0 — 2022-05-30
- 5.0.1 — 2021-11-13
- 5.0.0 — 2021-11-09
- 4.1.1 — 2021-11-01
- 4.1.0 — 2021-10-31
- 4.0.0 — 2021-10-22
- 3.2.1 — 2021-04-04
- 3.2.0 — 2021-04-04
- 3.1.0 — 2018-08-09
- 3.0.0 — 2018-02-18
- … 4 more at https://npm.io/package/just-clone/versions

## README

<!-- DO NOT EDIT THIS FILE! THIS FILE WAS AUTOGENERATED BY TEMPLATE-MATE -->
<!-- SEE https://github.com/angus-c/just/blob/master/CONTRIBUTING.md#readme-template -->

## just-clone

Part of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.

[`🍦 Try it`](https://anguscroll.com/just/just-clone)

```shell
npm install just-clone
```
```shell
yarn add just-clone
```

Deep copies objects, arrays, maps and sets

```js
// Deep copies objects and arrays, doesn't clone functions

import clone from 'just-clone';

var arr = [1, 2, 3];
var subObj = { aa: 1 };
var obj = { a: 3, b: 5, c: arr, d: subObj };
var objClone = clone(obj);
arr.push(4);
objClone.d.bb = 2;
obj; // {a: 3, b: 5, c: [1, 2, 3, 4], d: {aa: 1}}
objClone; // {a: 3, b: 5, c: [1, 2, 3], d: {aa: 1, bb: 2}}
```

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