Gathering detailed insights and metrics for qclone
Gathering detailed insights and metrics for qclone
Gathering detailed insights and metrics for qclone
Gathering detailed insights and metrics for qclone
npm install qclone
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
20 Commits
2 Watching
1 Branches
1 Contributors
Updated on 14 Nov 2022
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-56.5%
50
Compared to previous day
Last week
-5.6%
336
Compared to previous week
Last month
64.8%
1,165
Compared to previous month
Last year
-30.2%
7,425
Compared to previous year
No dependencies detected.
the fastest function for deep clone js objects compatible with es6
*according to the author, this cloning script is the fastest in the industry(watch benchmarks)
npm install --save qclone
const qclone = require('qclone');
or connect separate modules:
const qclone = require('qclone/qcloneStrictCircular');
1const newCloneObj = qclone({ foo: 1 });
The library contains four cloning functions: qclone, qcloneStrict, qcloneCircular, qcloneStrictCircular.
For more than 90% of cases, the algorithm is suitable - qclone. If you lack it, for example, for cyclic objects or strict copying, you can use the following algorithms:
For more balanced testing of performance, tests of other projects were used
Nodejs - v13.3.0
Date - 22.01.2020
rfdc project test result
benchDeepCopy*100: 7776.478ms
benchLodashCloneDeep*100: 20040.199ms
benchFastCopy*100: 10990.298ms
benchRfdc*100: 4435.846ms
benchQclone*100: 3481.686ms
benchQcloneCircular*100: 5113.696ms
benchQcloneStrict*100: 47226.868ms
benchQcloneStrictCircular*100: 48079.723ms
benchRfdcProto*100: 4354.412ms
benchRfdcCircles*100: 5461.455ms
benchRfdcCirclesProto*100: 5541.977ms
fast-copy project test result
Name | Ops / sec |
---|---|
qclone | 2,069.919 |
qcloneCircular | 1,092.98 |
fast-copy | 674.629 |
lodash.cloneDeep | 323.661 |
clone | 323.007 |
ramda | 206.035 |
deepclone | 175.292 |
qcloneStrictCircular | 156.258 |
fast-copy (strict) | 151.173 |
fast-clone | 125.238 |
qcloneStrict | 121.703 |
Nodejs - v14.9.0
Date - 01.10.2020
klona project test result
Benchmark :: json
JSON.stringify x 18,355 ops/sec ±0.68% (83 runs sampled)
lodash x 19,501 ops/sec ±0.53% (87 runs sampled)
rfdc x 90,519 ops/sec ±0.57% (88 runs sampled)
clone x 16,963 ops/sec ±0.33% (88 runs sampled)
clone/include x 9,343 ops/sec ±0.70% (90 runs sampled)
clone-deep x 52,055 ops/sec ±0.79% (89 runs sampled)
deep-copy x 51,496 ops/sec ±0.22% (87 runs sampled)
klona/full x 21,732 ops/sec ±0.24% (92 runs sampled)
klona x 114,363 ops/sec ±0.57% (89 runs sampled)
klona/lite x 127,689 ops/sec ±0.57% (88 runs sampled)
klona/json x 136,417 ops/sec ±0.23% (92 runs sampled)
qclone x 141,203 ops/sec ±0.41% (90 runs sampled)
Benchmark :: lite
lodash x 14,211 ops/sec ±0.36% (92 runs sampled)
clone x 14,738 ops/sec ±1.38% (87 runs sampled)
clone/include x 7,970 ops/sec ±0.67% (89 runs sampled)
clone-deep x 41,739 ops/sec ±0.47% (90 runs sampled)
klona/full x 18,371 ops/sec ±0.34% (89 runs sampled)
klona x 89,160 ops/sec ±0.42% (91 runs sampled)
klona/lite x 97,288 ops/sec ±0.65% (90 runs sampled)
qclone x 109,539 ops/sec ±0.27% (90 runs sampled)
*The next two tests below clone the keys for the Map class if those are objects. I do not consider this behavior to be correct, since the work for such keys is based on references and not values (most cloning libraries support my opinion).
Benchmark :: default
lodash x 14,529 ops/sec ±2.64% (82 runs sampled)
clone x 31,979 ops/sec ±0.35% (88 runs sampled)
clone/include x 18,751 ops/sec ±0.50% (87 runs sampled)
klona/full x 30,788 ops/sec ±1.00% (88 runs sampled)
klona x 77,617 ops/sec ±0.34% (91 runs sampled)
qclone x 169,658 ops/sec ±0.59% (90 runs sampled)
Benchmark :: full
lBenchmark :: full
lodash x 15,230 ops/sec ±3.17% (89 runs sampled)
clone/include x 13,651 ops/sec ±0.43% (86 runs sampled)
klona/full x 26,493 ops/sec ±2.05% (92 runs sampled)
qclone(qcloneStrict) x 39,462 ops/sec ±1.05% (90 runs sampled)
MIT Yuriy Khomenko
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More