Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

editor-json-parser

albin328ISC1.1.1

this repo support parse standard json and something like this:

readme

editor-json-parser

this repo support parse standard json and something like this:

Build Status NPM Version NPM Downloads

support: AMD / CommonJs / script tag

{
  "foo": 'bar'
}

{
  foo: 'bar'
}

{
  'foo': "bar"
}

it also support comments and comma at last line

{
  // comment
  foo: 'bar'    // comment
}

{
  foo: 'bar',
  foo1: 'bar1',
}

commonjs usage

npm install --save editor-json-parser

let parser = require('editor-json-parser');
let result = parser.parse("{foo: 'bar'}");
// result: {foo: 'bar'}
result = parser.parse("{'foo': 'bar'}");
// result: {foo: 'bar'}
result = parser.parse('{"foo": "bar"}');
// result: {foo: 'bar'}

script tag

<script src="./dist/json_parser.js"><script/>

var jsonParser = window.json_parser;

AMD support

...