1.0.2 • Published 7 years ago

json-parse-better-errors v1.0.2

Weekly downloads
14,868,240
License
MIT
Repository
github
Last release
7 years ago

json-parse-better-errors npm version license Travis AppVeyor Coverage Status

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

Install

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

Table of Contents

Example

const parseJson = 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! The Contributor 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 follow Code of Conduct, and just generally be excellent to each other.

Please refer to the Changelog for project history details, too.

Happy hacking!

API

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

Works just like JSON.parse, but will include a bit more information when an error happens.

node-fetch-npmthread-loaderarchetype-librarycomponennentteasy-select-rnchinjowwchinjowvuedragdropuploadimagesreact-native-bluetooth2killi8n-react-native-fast-imagern-send-sms@icanpm/api-master@cashremit/cr-streamline-iconsreact-native-template-rfbasecloud-archive-s3cq-batch-templateairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxfquasar-app-extension-imagina-extgenerator-430bfgenerator-bfdeneme323112@texttree/demo-bsa-reference-rcl@fundefund/funde_ck@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjamesreact-native-covid-sdkgql_din_modreact-native-thanh-toast-librarymutasi-bca@jttechnic/interpreter@sap/generator-fiori-elements@thanhnguyen14797/react-native-thanh-toast-library@l1nyanm1ng/react-picture-viewerreact-native-printer-brothersrn-pdf-reader-offlinecbmis-ai-toolbox@meicloud/clireact-native-shekhar-bridge-testcogoportutilslevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29wilscanner@oiti/documentoscopy-react-nativejs4cytoscape@mink-opn/build-tokensquoc-testreact-native-slider-kfunblock-block-save-variables@infinitebrahmanuniverse/nolb-json-pcclibyarntest@saaspe/componentsluminos-ui-core@everything-registry/sub-chunk-1984jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-table@rabailriaz/hisaab-web-portalreact-native-jawwy_samplegriffin-ui-librarytailwind-vector-effecttest-carosello-campustest-library-123test-haptik-libtest-npm-jjmessiwinx-form-winxweb-elements-iconsvue-button-test1webdatabasetest1webdatabasetest10webchewebpack4dmallwebpack_base420wwzwebpackwifi_configuration_packagewuchuanxhs-mp-compiler-new-clixhs-mp-packs3-modulern-tm-notifyrn-use-modal-hookrn-currency-formatterrn-counter-demorn-session-multiplier-demorn_unique_device_id
1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago