# stringify-clone

> Wrapper for fast object cloning using `JSON.parse` & `JSON.stringify`

Latest version **3.0.2** (published 2023-09-05) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2023-09-05 |
| First published | 2015-05-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ahmad Nassri |
| Maintainers | ahmadnassri |
| Keywords | stringify, clone |

## Links

- npm: https://www.npmjs.com/package/stringify-clone
- Repository: https://github.com/ahmadnassri/node-stringify-clone
- Issues: https://github.com/ahmadnassri/node-stringify-clone/issues
- Funding: https://github.com/sponsors/ahmadnassri
- npm.io page: https://npm.io/package/stringify-clone

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 3.0.2 (latest) — 2023-09-05
- 3.0.1 — 2023-01-02
- 3.0.0 — 2022-07-28
- 2.0.12 — 2021-10-12
- 2.0.11 — 2021-10-12
- 2.0.10 — 2021-08-12
- 2.0.9 — 2021-06-12
- 2.0.8 — 2021-05-11
- 2.0.7 — 2021-05-11
- 2.0.6 — 2021-04-16
- 2.0.5 — 2021-02-28
- 2.0.4 — 2021-02-28
- 2.0.3 — 2020-08-05
- 2.0.2 — 2020-08-05
- 2.0.1 — 2018-11-05
- … 4 more at https://npm.io/package/stringify-clone/versions

## README

# Stringify Clone

Wrapper for fast object cloning using `JSON.parse` & `JSON.stringify`

[![license][license-img]][license-url]
[![release][release-img]][release-url]
[![semantic][semantic-img]][semantic-url]

**IMPORTANT:**

> **THIS IS A [ONE LINE PACKAGE][], THERE IS NO REASON FOR YOU TO USE IT!**

**Notes**:

-   cannot clone `RegExp` *(returns `{}`)*
-   `NaN` values will be converted to `null`
-   `Date` objects will be converted to ISO strings (equivalent of running `Date.toISOString()`)
    -   you can reconstruct the Date by calling `new Date(string)`

## Install

``` bash
npm install stringify-clone
```

## Usage

## API

### clone()

``` js
const clone = require('stringify-clone')

clone({
  foo: 'bar'
})
```

  [ONE LINE PACKAGE]: ./index.js

----
> Author: [Ahmad Nassri](https://www.ahmadnassri.com/) &bull;
> Twitter: [@AhmadNassri](https://twitter.com/AhmadNassri)

[license-url]: LICENSE
[license-img]: https://badgen.net/github/license/ahmadnassri/node-stringify-clone

[release-url]: https://github.com/ahmadnassri/node-stringify-clone/releases
[release-img]: https://badgen.net/github/release/ahmadnassri/node-stringify-clone

[semantic-url]: https://github.com/ahmadnassri/node-stringify-clone/actions?query=workflow%3Arelease
[semantic-img]: https://badgen.net/badge/📦/semantically%20released/blue

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