
Company News
Socket Named to Rising in Cyber 2026 List of Top Cybersecurity Startups
Socket was named to the Rising in Cyber 2026 list, recognizing 30 private cybersecurity startups selected by CISOs and security executives.
JSON.prune is a pruning JSON.stringify for the very specific cases where you need to stringify big or recursive javascript objects and don't really need the result to be complete.
JSON.prune is a pruning JSON.stringify for the very specific cases where you need to stringify big or recursive javascript objects and don't really need the result to be complete.
JSON.prune also lets you, in case of need, stringify inherited and/or non enumerable properties.
JSON.prune(window.location, {inheritedProperties:true}); // without inherited properties, FireFox and IE only show an empty object
It's totally useless for at least 99% of js developpers.
JSON.prune.log is a proxy over console.log deep cloning the objects (using JSON.prune) before logging them, in order to avoid the delay problem encountered on non primitive objects logging.
You should not use it frequently, only when you really need to see the objects how they were at logging time.
// make sure someObject is logged as it was at logging time
JSON.prune.log(someObject);
Install with npm
npm install json_prune
Use it in node as standard module
var JSONPrune = require('json_prune').prune
...
var prunedObj = JSONPrune(objectToPrune)
Include it
<script src=http://dystroy.org/JSON.prune/.js></script>
Use it with
var json = JSON.stringify(window); // fails
var json = JSON.prune(window); // builds a JSON valid string from a pruned version of the
// recursive, deep, and not totally accessible window object
var prunedWindow = JSON.parse(JSON.prune(window)); // builds a lighter acyclic version of window
Public Domain. Use as you wish and at your own risk.
FAQs
JSON.prune is a pruning JSON.stringify for the very specific cases where you need to stringify big or recursive javascript objects and don't really need the result to be complete.
We found that json_prune 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.

Company News
Socket was named to the Rising in Cyber 2026 list, recognizing 30 private cybersecurity startups selected by CISOs and security executives.

Research
Socket detected 84 compromised TanStack npm package artifacts modified with suspected CI credential-stealing malware.

Security News
A dispute over fsnotify maintainer access set off supply chain alarms around one of Go’s most widely used filesystem libraries.