0.1.3 • Published 2 years ago

jsonc-wasm v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

jsonc-wasm

npm version License: MIT

By using this package, you can acquire JSON strings that can be parsed from JSONC(JSON with comment).

Install

$ npm install jsonc-wasm
$ yarn add jsonc-wasm

Usage

import('jsonc-wasm').then(({ toJsonString }) => {
  const res = toJsonString(`{
  // comment line
  /**
   * comment block
   */
  "browsers": {
    "firefox": {
      "name": "Firefox", // FF
      "pref_url": "about:config",
      "releases": {
        "1": {
          "release_date": "2004-11-09",
          "status": "retired",
          "engine": "Gecko",
          "engine_version": "1.7"
        }
      }
    }
  }
}`)
  console.log(JSON.parse(res))
})

Feature

  • You can remove comment in JSONC.
  • You can use trailing comma.
0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago