Gathering detailed insights and metrics for @casual-simulation/fast-json-stable-stringify
Gathering detailed insights and metrics for @casual-simulation/fast-json-stable-stringify
Gathering detailed insights and metrics for @casual-simulation/fast-json-stable-stringify
Gathering detailed insights and metrics for @casual-simulation/fast-json-stable-stringify
Casual Open Simulation for the Web
npm install @casual-simulation/fast-json-stable-stringify
Typescript
Module System
Min. Node Version
Node Version
NPM Version
72.2
Supply Chain
99.3
Quality
92.3
Maintenance
100
Vulnerability
100
License
TypeScript (67.1%)
JavaScript (27.43%)
TeX (3.8%)
Vue (1.23%)
CSS (0.26%)
HTML (0.1%)
Shell (0.04%)
SCSS (0.02%)
Dockerfile (0.01%)
Total Downloads
20,826
Last Day
2
Last Week
50
Last Month
359
Last Year
6,459
NOASSERTION License
53 Stars
14,082 Commits
10 Forks
7 Watchers
267 Branches
13 Contributors
Updated on Jun 23, 2025
Minified
Minified + Gzipped
Latest Version
3.5.0
Package Id
@casual-simulation/fast-json-stable-stringify@3.5.0
Unpacked Size
177.71 kB
Size
44.56 kB
File Count
9
NPM Version
lerna/8.0.0/node@v20.19.1+x64 (linux)
Node Version
20.19.1
Published on
Jun 06, 2025
Cumulative downloads
Total Downloads
Last Day
100%
2
Compared to previous day
Last Week
-80.4%
50
Compared to previous week
Last Month
-55.5%
359
Compared to previous month
Last Year
-12.4%
6,459
Compared to previous year
No dependencies detected.
Forked from https://github.com/epoberezkin/fast-json-stable-stringify. Changes include converting to TypeScript and adding the ability to indent JSON output.
Deterministic JSON.stringify()
- a faster version of @substack's json-stable-strigify without jsonify.
You can also pass in a custom comparison function.
1var stringify = require('fast-json-stable-stringify'); 2var obj = { c: 8, b: [{ z: 6, y: 5, x: 4 }, 7], a: 3 }; 3console.log(stringify(obj));
output:
{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}
1var stringify = require('fast-json-stable-stringify');
Return a deterministic stringified string str
from the object obj
.
If opts
is given, you can supply an opts.cmp
to have a custom comparison
function for object keys. Your function opts.cmp
is called with these
parameters:
1opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue });
For example, to sort on the object key names in reverse order you could write:
1var stringify = require('fast-json-stable-stringify'); 2 3var obj = { c: 8, b: [{ z: 6, y: 5, x: 4 }, 7], a: 3 }; 4var s = stringify(obj, function (a, b) { 5 return a.key < b.key ? 1 : -1; 6}); 7console.log(s);
which results in the output string:
{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}
Or if you wanted to sort on the object values in reverse order, you could write:
var stringify = require('fast-json-stable-stringify');
var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 };
var s = stringify(obj, function (a, b) {
return a.value < b.value ? 1 : -1;
});
console.log(s);
which outputs:
{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10}
Pass true
in opts.cycles
to stringify circular property as __cycle__
- the result will not be a valid JSON string in this case.
TypeError will be thrown in case of circular object without this option.
With npm do:
npm install fast-json-stable-stringify
To run benchmark (requires Node.js 6+):
node benchmark
Results:
fast-json-stable-stringify x 17,189 ops/sec ±1.43% (83 runs sampled)
json-stable-stringify x 13,634 ops/sec ±1.39% (85 runs sampled)
fast-stable-stringify x 20,212 ops/sec ±1.20% (84 runs sampled)
faster-stable-stringify x 15,549 ops/sec ±1.12% (84 runs sampled)
The fastest is fast-stable-stringify
fast-json-stable-stringify package is a part of Tidelift enterprise subscription - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.
No vulnerabilities found.
Reason
30 commit(s) and 20 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
packaging workflow detected
Details
Reason
project is fuzzed
Details
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
29 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
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