
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
json-simple
Advanced tools
Fast JSON encoder. Handles a simplified subset of the input accepted by JSON.stringify, but runs 2x faster. Ideal for encoding data for export, won't work for arbitrary object serialization.
Data exchange formats are simple; they tend to be plain arrays or hashes with no inherited properties, simple ascii property names, containing fairly simple data layouts. Targeting this narrower domain allows the code to run faster.
Supports the primitive types string
, number
, list (Array
), hash
(Object
), and the special values null
, undefined
, NaN
, and Infinite
.
Nested arrays and nested objects work too.
Outputs a JSON.parse
compatible string.
json = require('json-simple');
var data = [0, "one", {two: 2}];
var str = json.encode(data); // => [0,"one",{"two":2}]
json.decode(str); // => data
JSON.parse(str); // => data
npm install json-simple
npm test json-simple
Convert the data into a json string. Converts arrays, objects, numbers, strings and special values (see Supported Types below).
json = require('json-simple');
json.encode({a:1, b:"two"});
Parse the json string into the corresponding native data item.
json = require('json-simple');
json.decode('{"a":1,"b":"two"}');
encode(arguments)
creates an stringified array.toISOString()
{}
Date
is not special, treated as Object (JSON would emit formatted string)RegExp
is not special, treated as Object (Json would emit {})Function
is not special (JSON would emit undefined)Buffer
encodes as an array (like JSON), but arguments
does too (unlike JSON).
Empty array-like objects are encoded as objects.JSON.parse(json)
or eval("'" + json + "'")
will both work.FAQs
fast nodejs json encoder
We found that json-simple 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.