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

tolerant-json-parser

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tolerant-json-parser

Tolerant JSON parser

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

Tolerant JSON parser

npm package npm bundle size Build Status Downloads Issues Commitizen Friendly Semantic Release

A very tolerant JSON parser. It supports all the current JSON standard, along with the following tollerances added:

  • Unquoted keys
  • Single-quotes strings
  • Multi-line template strings without interpolations (some string)
  • Multi-line comments (/* ... */)
  • Single-line comments (// ...)
  • Trailing commas

** Warning ** This package does not work with Safari browser as Safari still does not support lookbehind in JS regular expression

Install

npm install tolerant-json-parser

Usage

import { parse } from 'tolerant-json-parser';

parse(`
{
  
  [\`some template string without interpolation\`]: \`
    some multline template string
    without interpolation
  \`,/*
    some multiline comment
  */
  foo: 'bar',
  "baz": false, // some single-line comment
  'foo-baz': [1,2,3, ],
`);

Keywords

tolerant

FAQs

Package last updated on 29 Jan 2023

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