Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

get better errors

License

NotificationsYou must be signed in to change notification settings

zkat/json-parse-better-errors

Repository files navigation

json-parse-better-errors is a Node.js library forgetting nicer errors out ofJSON.parse(), including context and position of the parse errors.

Install

$ npm install --save json-parse-better-errors

Table of Contents

Example

constparseJson=require('json-parse-better-errors')parseJson('"foo"')parseJson('garbage')// more useful error message

Features

  • Like JSON.parse, but the errors are better.

Contributing

The npm team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! TheContributor Guide has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.

All participants and maintainers in this project are expected to followCode of Conduct, and just generally be excellent to each other.

Please refer to theChangelog for project history details, too.

Happy hacking!

API

> parse(txt, ?reviver, ?context=20)

Works just likeJSON.parse, but will include a bit more information when anerror happens.

About

get better errors

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp