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

parse-json

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-json - npm Package Compare versions

Comparing version 5.2.0 to 6.0.0

24

index.js

@@ -1,13 +0,15 @@

'use strict';
const errorEx = require('error-ex');
const fallback = require('json-parse-even-better-errors');
import {createRequire} from 'node:module';
import errorEx from 'error-ex';
import fallback from 'json-parse-even-better-errors';
import {codeFrameColumns} from '@babel/code-frame';
const require = createRequire(import.meta.url);
const {default: LinesAndColumns} = require('lines-and-columns');
const {codeFrameColumns} = require('@babel/code-frame');
const JSONError = errorEx('JSONError', {
export const JSONError = errorEx('JSONError', {
fileName: errorEx.append('in %s'),
codeFrame: errorEx.append('\n\n%s\n')
codeFrame: errorEx.append('\n\n%s\n'),
});
const parseJson = (string, reviver, filename) => {
export default function parseJson(string, reviver, filename) {
if (typeof reviver === 'string') {

@@ -42,3 +44,3 @@ filename = reviver;

{start: {line: location.line + 1, column: location.column + 1}},
{highlightCode: true}
{highlightCode: true},
);

@@ -51,6 +53,2 @@

}
};
parseJson.JSONError = JSONError;
module.exports = parseJson;
}
{
"name": "parse-json",
"version": "5.2.0",
"version": "6.0.0",
"description": "Parse JSON with more helpful errors",

@@ -13,4 +13,6 @@ "license": "MIT",

},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},

@@ -36,12 +38,12 @@ "scripts": {

"dependencies": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"@babel/code-frame": "^7.16.0",
"error-ex": "^1.3.2",
"json-parse-even-better-errors": "^2.3.1",
"lines-and-columns": "^1.1.6"
},
"devDependencies": {
"ava": "^1.4.1",
"nyc": "^14.1.1",
"xo": "^0.24.0"
"ava": "^3.15.0",
"nyc": "^15.1.0",
"xo": "^0.46.4"
}
}

@@ -7,5 +7,5 @@ # parse-json

```sh
npm install parse-json
```
$ npm install parse-json
```

@@ -15,3 +15,3 @@ ## Usage

```js
const parseJson = require('parse-json');
import parseJson from 'parse-json';

@@ -93,3 +93,3 @@ const json = '{\n\t"foo": true,\n}';

Filename displayed in the error message.
The filename displayed in the error message.

@@ -96,0 +96,0 @@ ### parseJson.JSONError

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