@luxass/strip-json-comments@1.4.0Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
strip comments from your json
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
88%
Published
6 months ago (1.4.0)
strip-json-comments
A fork of sindresorhus/strip-json-comments but with support for CJS & ESM. And some small modifications.
📦 Installation
npm install @luxass/strip-json-comments
📚 Usage
There is a small difference to the original package. You can see it here.
import { strip } from "@luxass/strip-json-comments"; const json = `{ // this is a comment "foo": /* this is also a comment */ "bar" }`; JSON.parse(strip(json)); // { foo: "bar" }
Differences to sindresorhus/strip-json-comments
The main differences are:
- This package is published as ESM & CJS
- And the
default export
is moved to anamed export
calledstrip
- import stripJsonComments from "strip-json-comments"; + import { strip } from "@luxass/strip-json-comments";
📄 License
Published under MIT License.
Built and signed on
GitHub Actions
Add Package
deno add jsr:@luxass/strip-json-comments
Import symbol
import * as strip_json_comments from "@luxass/strip-json-comments";
Import directly with a jsr specifier
import * as strip_json_comments from "jsr:@luxass/strip-json-comments";
Add Package
pnpm i jsr:@luxass/strip-json-comments
pnpm dlx jsr add @luxass/strip-json-comments
Import symbol
import * as strip_json_comments from "@luxass/strip-json-comments";
Add Package
yarn add jsr:@luxass/strip-json-comments
yarn dlx jsr add @luxass/strip-json-comments
Import symbol
import * as strip_json_comments from "@luxass/strip-json-comments";
Add Package
vlt install jsr:@luxass/strip-json-comments
Import symbol
import * as strip_json_comments from "@luxass/strip-json-comments";
Add Package
npx jsr add @luxass/strip-json-comments
Import symbol
import * as strip_json_comments from "@luxass/strip-json-comments";
Add Package
bunx jsr add @luxass/strip-json-comments
Import symbol
import * as strip_json_comments from "@luxass/strip-json-comments";