Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 15, 2024 via pnpm

json5 2.2.3

JSON for Humans
Package summary
Share
0
issues
1
license
1
MIT
Package created
27 May 2012
Version published
31 Dec 2022
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
json5@2.2.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of json5 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does json5 do?

JSON5 is a JavaScript library and an extension to the widely-used JSON file format, with the aim of making it easier to write and maintain manually - particularly in the context of configuration files. It's not designed for machine-to-machine communication, for which regular JSON should still be used. The JSON5 Data Interchange Format is a superset of JSON, meaning all valid JSON files will also be valid JSON5 files. This extension introduces several features from ECMAScript 5.1 (ES5) to JSON, and is also a strict subset of ES5, hence all valid JSON5 files will also be valid ES5.

How do you use json5?

Using JSON5 involves a simple installation process via npm, followed by requiring or importing the library into your JavaScript files. For Node.js, you start by installing it with the command npm install json5. Then, if you're using CommonJS, you can include it in your file using const JSON5 = require('json5'), or if using Modules, use import JSON5 from 'json5'.

With JSON5 successfully imported, you can start utilizing it's API. For instance, JSON5.parse(text[, reviver]) can be used to parse a JSON5 string and construct the JavaScript value or object it describes. As a usage example:

const JSON5 = require('json5')

const jsonString = `{
  hello: 'world',
  list: ['item1', 'item2', 'item3',]
}`

const jsonObject = JSON5.parse(jsonString)
console.log(jsonObject)

You can also use JSON5 functionalities on a browser. For instance, including it in your HTML file from a CDN like so:

<script src="https://unpkg.com/json5@2/dist/index.min.js"></script>

This will create a global JSON5 variable for use in your client-side JS scripts.

Where are the json5 docs?

The in-depth documentation for JSON5, including a detailed explanation of the JSON5 format, its API and CLI usage, as well as contribution guidelines, can be found directly on the official GitHub repository (https://github.com/json5/json5). The formal JSON5 Interchange Format specification is also accessible at the external dedicated site (https://spec.json5.org/).