Socket
Socket
Sign inDemoInstall

@luxass/strip-json-comments

Package Overview
Dependencies
0
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @luxass/strip-json-comments

strip comments from your json


Version published
Maintainers
0
Created

Readme

Source

strip-json-comments

npm version npm downloads

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 a named export called strip
- import stripJsonComments from "strip-json-comments";
+ import { strip } from "@luxass/strip-json-comments";

📄 License

Published under MIT License.

Keywords

FAQs

Last updated on 30 Jun 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc