Gathering detailed insights and metrics for @ndelangen/flatted
Gathering detailed insights and metrics for @ndelangen/flatted
npm install @ndelangen/flatted
Typescript
Module System
Node Version
NPM Version
71.7
Supply Chain
83.1
Quality
75
Maintenance
100
Vulnerability
100
License
JavaScript (66.3%)
PHP (19.39%)
Python (13.38%)
HTML (0.93%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
666
Last Day
3
Last Week
93
Last Month
133
Last Year
187
ISC License
1,063 Stars
137 Commits
49 Forks
10 Watchers
4 Branches
10 Contributors
Updated on Feb 20, 2025
Latest Version
1.0.3
Package Id
@ndelangen/flatted@1.0.3
Unpacked Size
42.04 kB
Size
16.09 kB
File Count
9
NPM Version
5.6.0
Node Version
8.11.3
Cumulative downloads
Total Downloads
Last Day
-88.5%
3
Compared to previous day
Last Week
210%
93
Compared to previous week
Last Month
1,230%
133
Compared to previous month
Last Year
42.7%
187
Compared to previous year
6
A super light (0.5K) and fast circular JSON parser, directly from the creator of CircularJSON.
Usable via CDN or as regular module.
1// ESM 2import {parse, stringify} from 'flatted/esm'; 3 4// CJS 5const {parse, stringify} = require('flatted/cjs'); 6 7const a = [{}]; 8a[0].a = a; 9a.push(a); 10 11stringify(a); // [["1","0"],{"a":"0"}]
.parse(string, reviver)
and revive your own objects.space
parameter to .stringify(object, replacer, space)
for feature parity with JSON signature.All ECMAScript engines compatible with Map
, Set
, Object.keys
, and Array.prototype.reduce
will work, even if polyfilled.
While stringifying, all Objects, including Arrays, and strings, are flattened out and replaced as unique index. *
Once parsed, all indexes will be replaced through the flattened collection.
*
represented as string to avoid conflicts with numbers
1// logic example 2var a = [{one: 1}, {two: '2'}]; 3a[0].a = a; 4// a is the main object, will be at index '0' 5// {one: 1} is the second object, index '1' 6// {two: '2'} the third, in '2', and it has a string 7// which will be found at index '3' 8 9Flatted.stringify(a); 10// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"] 11// a[one,two] {one: 1, a} {two: '2'} '2'
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
2 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 2
Reason
Found 0/26 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
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
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-17
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