New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

json-simple-parser

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-simple-parser

The fastest pure-JS implementation for JSON I could come up with.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
0
Created
Source

JSON Simple Parser

The fastest pure-JS implementation for JSON I could come up with.

There's no point in actually using this function, it mainly exists as a benchmark, to see what the ceiling is for a pure-JS manually written and painfully written JSON parser. This implementation doesn't call JSON.parse internally, it may use use some regexes if they perform better though.

This is about ~2.5x slower than JSON.parse in Node v22.

Install

npm install json-simple-parser

Usage

import parse from 'json-simple-parser';

// Let's parse some JSON

const json = `{
  "foo": "bar",
  "bar": 42,
  "baz": true,
  "qux": null,
  "corge": [1, 2, 3],
  "grault": {
    "garply": "waldo"
  }
}`;

const result = {
  foo: 'bar',
  bar: 42,
  baz: true,
  qux: null,
  corge: [1, 2, 3],
  grault: {
    garply: 'waldo'
  }
};

parse ( json ); // => result

License

MIT © Fabio Spampinato

Keywords

json

FAQs

Package last updated on 18 Feb 2025

Did you know?

Socket

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.

Install

Related posts