{"_id":"utils-error-reviver","_rev":"4-87edc30d2845b0063d5ed8f7e4961325","name":"utils-error-reviver","description":"Revives a JSON-serialized error object.","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"utils-error-reviver","version":"0.0.0","description":"Revives a JSON-serialized error object.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi","test-local":"tape \"./test/*.js\" | tap-spec","test-ci":"npm run test-local && xvfb-run npm run test-browsers","test-cov":"istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"","test-browsers":"browserify ./test/*.js | testling | tap-spec","coverage":"istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/kgryte/utils-error-reviver.git"},"keywords":["utilities","utility","utils","util","error","err","json","reviver","revive","unmarshal","deserialize","from","convert","parse","object","obj"],"bugs":{"url":"https://github.com/kgryte/utils-error-reviver/issues"},"dependencies":{"object-keys":"^1.0.9","validate.io-string-primitive":"^1.0.0"},"devDependencies":{"browserify":"12.x.x","chai":"^3.4.1","codecov.io":"^0.1.5","istanbul":"^0.4.1","jshint":"2.x.x","jshint-stylish":"2.x.x","tap-spec":"4.x.x","tape":"4.x.x","testling":"1.x.x","utils-copy":"^1.1.0","utils-error-to-json":"^1.0.0"},"testling":{"files":["test/*.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..latest","firefox/nightly","chrome/4.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"license":"MIT","gitHead":"c42f23e553f2d0249faf59b6f5e7826cb1771e44","homepage":"https://github.com/kgryte/utils-error-reviver#readme","_id":"utils-error-reviver@0.0.0","_shasum":"75826e4fd42e148aa7f655ec17bce81bb655a305","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"75826e4fd42e148aa7f655ec17bce81bb655a305","tarball":"https://registry.npmjs.org/utils-error-reviver/-/utils-error-reviver-0.0.0.tgz","integrity":"sha512-WIgfwexMZ1cpLQ4Ck7Xlr0/pBWIF5Vhn+nCdW5IBRAzFSwATIAyoR/QxZ/PR+6EtwAlqeXKFact9JxfcOfjMxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDes78KoIUUOOYnY8jTZR8yS9hbLEeZaTkHQP7VNCVswwIgWYM2dYqB1+BolTrQcDWrootVUGQj49AFTeoWLYKwGT8="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]},"1.0.0":{"name":"utils-error-reviver","version":"1.0.0","description":"Revives a JSON-serialized error object.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi","test-local":"tape \"./test/*.js\" | tap-spec","test-ci":"npm run test-local && xvfb-run npm run test-browsers","test-cov":"istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"","test-browsers":"browserify ./test/*.js | testling | tap-spec","coverage":"istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov"},"main":"./lib","repository":{"type":"git","url":"git://github.com/kgryte/utils-error-reviver.git"},"keywords":["utilities","utility","utils","util","error","err","json","reviver","revive","unmarshal","deserialize","from","convert","parse","object","obj"],"bugs":{"url":"https://github.com/kgryte/utils-error-reviver/issues"},"dependencies":{"object-keys":"^1.0.9","validate.io-string-primitive":"^1.0.0"},"devDependencies":{"browserify":"12.x.x","chai":"^3.4.1","codecov.io":"^0.1.5","istanbul":"^0.4.1","jshint":"2.x.x","jshint-stylish":"2.x.x","tap-spec":"4.x.x","tape":"4.x.x","testling":"1.x.x","utils-copy":"^1.1.0","utils-error-to-json":"^1.0.0"},"testling":{"files":["test/*.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..latest","firefox/nightly","chrome/4.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"license":"MIT","gitHead":"739b1045411a607fa7126996c43a78043f2a7a34","homepage":"https://github.com/kgryte/utils-error-reviver#readme","_id":"utils-error-reviver@1.0.0","_shasum":"152d4b34e5a42c123b2da50450bd54de85ec25cf","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"152d4b34e5a42c123b2da50450bd54de85ec25cf","tarball":"https://registry.npmjs.org/utils-error-reviver/-/utils-error-reviver-1.0.0.tgz","integrity":"sha512-C+FS8wi/SEz9O72zLbMVrNABVDtYud7vkEWLiIPr38Q0KVMPxhwL/8BK3vVu8GMP10pcYN5CStC7kqdE7dKJxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKV23vQtD+nu7MYLSnsMFRbGWV9wDOqBy71waF6plLyQIgG2sLQXzdEJQR/4kth/qo8sTR46U2YApayoDJVLnyl20="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]}},"readme":"Error Reviver\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n> Revives a JSON-serialized [error][utils-error-to-json] object.\n\n\n## Installation\n\n``` bash\n$ npm install utils-error-reviver\n```\n\n\n## Usage\n\n``` javascript\nvar revive = require( 'utils-error-reviver' );\n```\n\n#### revive( key, value )\n\nRevives a JSON-serialized [error][utils-error-to-json] object.\n\n``` javascript\nvar str = '{\"type\":\"TypeError\",\"message\":\"beep\"}';\n\nvar err = JSON.parse( str, revive );\n// returns <TypeError>\n```\n\nFor details on the JSON serialization format, see [utils-error-to-json][utils-error-to-json].\n\n\n## Notes\n\n*\tSupported built-in [`error`][js-error] types:\n\t-\t[`Error`][js-error]\n\t- \t[`URIError`][js-uri-error]\n\t-\t[`ReferenceError`][js-reference-error]\n\t-\t[`SyntaxError`][js-syntax-error]\n\t-\t[`RangeError`][js-range-error]\n\t-\t[`EvalError`][js-eval-error]\n\t-\t[`TypeError`][js-type-error]\n\n\n## Examples\n\n``` javascript\nvar toJSON = require( 'utils-error-to-json' );\nvar revive = require( 'utils-error-reviver' );\n\nvar err1 = new SyntaxError( 'bad syntax' );\n// returns <SyntaxError>\n\nvar json = toJSON( err1 );\n/*\n  {\n    \"type\": \"SyntaxError\",\n    \"name\": \"SyntaxError\",\n    \"message\": \"bad syntax\",\n    \"stack\": \"<stack>\"\n  }\n*/\n\nvar str = JSON.stringify( json );\n// returns '{\"type\":\"SyntaxError\",\"name\":\"SyntaxError\",\"message\":\"bad syntax\",\"stack\":\"<stack>\"}'\n\nvar err2 = JSON.parse( str, revive );\n// returns <SyntaxError>\n\nconsole.log( err1.message === err2.message );\n// returns true\n\nconsole.log( err1.stack === err2.stack );\n// returns true\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n---\n## Tests\n\n### Unit\n\nThis repository uses [tape][tape] for unit tests. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul][istanbul] as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n### Browser Support\n\nThis repository uses [Testling][testling] for browser testing. To run the tests in a (headless) local web browser, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-browsers\n```\n\nTo view the tests in a local web browser,\n\n``` bash\n$ make view-browser-tests\n```\n\n<!-- [![browser support][browsers-image]][browsers-url] -->\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n\n## Copyright\n\nCopyright &copy; 2015. Athan Reines.\n\n\n[npm-image]: http://img.shields.io/npm/v/utils-error-reviver.svg\n[npm-url]: https://npmjs.org/package/utils-error-reviver\n\n[build-image]: http://img.shields.io/travis/kgryte/utils-error-reviver/master.svg\n[build-url]: https://travis-ci.org/kgryte/utils-error-reviver\n\n[coverage-image]: https://img.shields.io/codecov/c/github/kgryte/utils-error-reviver/master.svg\n[coverage-url]: https://codecov.io/github/kgryte/utils-error-reviver?branch=master\n\n[dependencies-image]: http://img.shields.io/david/kgryte/utils-error-reviver.svg\n[dependencies-url]: https://david-dm.org/kgryte/utils-error-reviver\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/kgryte/utils-error-reviver.svg\n[dev-dependencies-url]: https://david-dm.org/dev/kgryte/utils-error-reviver\n\n[github-issues-image]: http://img.shields.io/github/issues/kgryte/utils-error-reviver.svg\n[github-issues-url]: https://github.com/kgryte/utils-error-reviver/issues\n\n[tape]: https://github.com/substack/tape\n[istanbul]: https://github.com/gotwarlost/istanbul\n[testling]: https://ci.testling.com\n\n[utils-error-to-json]: https://github.com/kgryte/utils-error-to-json\n\n[js-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n[js-type-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\n[js-syntax-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError\n[js-range-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError\n[js-reference-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError\n[js-uri-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError\n[js-eval-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError\n","maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"time":{"modified":"2022-06-28T07:24:54.419Z","created":"2015-12-31T08:48:21.924Z","0.0.0":"2015-12-31T08:48:21.924Z","1.0.0":"2015-12-31T08:48:45.163Z"},"homepage":"https://github.com/kgryte/utils-error-reviver#readme","keywords":["utilities","utility","utils","util","error","err","json","reviver","revive","unmarshal","deserialize","from","convert","parse","object","obj"],"repository":{"type":"git","url":"git://github.com/kgryte/utils-error-reviver.git"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"bugs":{"url":"https://github.com/kgryte/utils-error-reviver/issues"},"license":"MIT","readmeFilename":"README.md"}