Package Exports
- tryjson
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tryjson) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node tryjson
This module works like JSON.parse
(and in fact it uses JSON.parse
) but instead of throwing exceptions it returns undefined
on failure. This is not always a desired behaviour but sometimes it is.
This is still work in progress.
Installation
Install to use in your Node project, updating the dependencies in package.json:
npm install tryjson --save
Examples
Basic usage:
var tryjson = require('tryjson');
console.log(tryjson.parse('{"a":1,"b":2}'));
// { a: 1, b: 2 }
console.log(tryjson.parse('{"a":1,"b":2'));
// undefined
Issues
For any bug reports or feature requests please post an issue on GitHub.
Author
Rafał Pocztarski - https://github.com/rsp
License
MIT License (Expat). See LICENSE.md for details.