SkillAgentSearch skills...

Nanoclone

Tiny util to deep clone JavaScript objects

Install / Use

/learn @Kelin2025/Nanoclone
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

nanoclone

license npm
Only 300B to deep clone JavaScript objects

Is it small enough?

See the size of the most popular clone npm package with 250M+ downloads image
And nanoclone size:
image

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

import clone from 'nanoclone'

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

let b = clone(a)

License

MIT

View on GitHub
GitHub Stars73
CategoryDevelopment
Updated10mo ago
Forks10

Languages

JavaScript

Security Score

87/100

Audited on May 6, 2025

No findings