Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@geek/jsonc

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geek/jsonc - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

15

jsonc.js
const jsonc = {};
const _ = require(`lodash`);
const fs = require(`fs-extra`);
module.exports = jsonc;

@@ -21,2 +23,15 @@

jsonc.readJsonc = async (file, options = {}) => {
const content = await fs.readFile(file, `utf8`);
const errors = [];
const { allowTrailingComma, allowEmptyContent, disallowComments } = options;
const json = jsonc.parse(content, errors, { allowTrailingComma, allowEmptyContent, disallowComments });
if (errors.length && options.throwErrors) {
throw errors[0];
}
return json;
};

2

package.json
{
"name": "@geek/jsonc",
"version": "1.0.5",
"version": "1.0.6",
"description": "JSONC and JSON utilities for JavaScript with Node.js",

@@ -5,0 +5,0 @@ "main": "jsonc.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc