You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

json-parse-context

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-parse-context

Add the context of a json parse error to the error message with syntax highlighting if possible.

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
1.9K
-51.93%
Maintainers
1
Weekly downloads
 
Created
Source

json-parse-context - One Amex

Add the context of a json parse error to the error message with syntax highlighting if possible.

npm Main Health Check

📖 Table of Contents


✨ Features

Example:

const jsonParseContext = require('json-parse-context');

jsonParseContext(`{
  "going": "to"
  "fail" true
}`);

terminal screenshot showing the line with a JSON syntax error surrounded by the previous and following lines


🎛️ API

jsonParseContext(serialized [, reviver [, options]])


📜 Available Scripts

In the project directory, you can run:

npm run test:git-history

Validates commit messages using commitlint

npm run test:lint

Verifies that your code matches the American Express code style defined in eslint-config-amex.

npm run test:lockfile

Validates package-lock.json with `lockfile-lint

npm run test:unit

Runs the unit tests using jest with the presets defined in amex-jest-preset.

npm test

Runs all of the above test:* commands


🎣 Git Hooks

These commands will be automatically run during normal git operations like committing code.

pre-commit

This hook runs npm test before allowing a commit to be checked in.

commit-msg

This hook verifies that your commit message matches the One Amex conventions. See the commit message section in the contribution guidelines.


🏆 Contributing

See contributing guidelines


🗝️ License

Any contributions made under this project will be governed by the Apache License 2.0.


🗣️ Code of Conduct

This project adheres to the American Express Community Guidelines. By participating, you are expected to honor these guidelines.

Keywords

json

FAQs

Package last updated on 21 Aug 2020

Did you know?

Socket

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