Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
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
The npm package json-simple receives a total of 0 weekly downloads. As such, json-simple popularity was classified as not popular.
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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.