
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
fast-clone
Advanced tools
The fastest deep cloning function on NPM that supports the following types:
Average runtime of various NPM clone libraries on a large complex object loaded from json files of varying sizes ranging from 3.5 MB to 15 MB.
Library | 7.15 MB |
---|---|
✔ fast-clone | 120 ms |
✘ deepClone | 138 ms |
✘ lodash.cloneDeep | 155 ms |
✘ snapshot | 1,127 ms |
✘ angular.copy | 1,942 ms |
✘ clone | 2,085 ms |
npm install fast-clone --save
yarn add fast-clone
Fast-clone is a UMD module so you can use it in Node.js, or in Browser either using Browserfy/Webpack, or by using the global clone function if not using a module loader.
import clone = require('fast-clone');
const clone = require('fast-clone');
const a = {
name: 'Natasha Rominov',
age: 30,
skills: [
'Pistols',
'Espionage'
],
dateOfBirth: new Date('1986-05-21T00:00:00.000Z')
};
const b = clone(a);
b.skills.push('That grabby thing she does with her legs');
console.log(a.skills)
console.log(b.skills);
Output will be:
['Pistols', 'Espionage']
['Pistols', 'Espionage', 'That grabby thing she does with her legs']
Got an issue or a feature request? Log it.
Pull-requests are also welcome. 😸
FAQs
Extremely fast deep cloning function
The npm package fast-clone receives a total of 10,999 weekly downloads. As such, fast-clone popularity was classified as popular.
We found that fast-clone demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.