jsonify-error
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -9,2 +9,7 @@ # Changelog | ||
## [1.1.2] - 2018-08-04 | ||
### Added | ||
- Multiple dists available for browsers (es6, es5, and minified). | ||
- dev: reorganized dependencies & scripts in package.json | ||
## [1.1.1] - 2018-02-21 | ||
@@ -20,3 +25,4 @@ ### Added | ||
[Unreleased]: https://github.com/papb/jsonify-error/compare/v1.1.1...HEAD | ||
[Unreleased]: https://github.com/papb/jsonify-error/compare/v1.1.2...HEAD | ||
[1.1.2]: https://github.com/papb/jsonify-error/compare/v1.1.1...v1.1.2 | ||
[1.1.1]: https://github.com/papb/jsonify-error/compare/v1.0.0...v1.1.1 |
{ | ||
"name": "jsonify-error", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Get a plain object fully representing the error for better logs and server responses.", | ||
@@ -11,4 +11,14 @@ "main": "index.js", | ||
"scripts": { | ||
"make_browser": "browserify make_browser.js -o browser.js" | ||
"build-dev-es6-watch": "watchify make_browser.js --outfile=\"dist/jsonify-error.js\" --verbose --debug", | ||
"build-dev-es6": "browserify --debug make_browser.js -o dist/jsonify-error.js", | ||
"build-es6": "npm run build-dev-es6 && uglifyjs dist/jsonify-error.js --compress --mangle -o dist/jsonify-error.min.js", | ||
"build-dev-es5": "browserify make_browser.js -o dist/jsonify-error.es5.js -t [ babelify --presets [ \"babel-preset-env\" ] ]", | ||
"build-es5": "npm run build-dev-es5 && uglifyjs dist/jsonify-error.es5.js --compress --mangle -o dist/jsonify-error.es5.min.js", | ||
"build": "npm run build-es6 && npm run build-es5", | ||
"lint": "eslint ." | ||
}, | ||
"files": [ | ||
"index.js", | ||
"make_browser.js" | ||
], | ||
"keywords": [ | ||
@@ -25,2 +35,11 @@ "error", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"babel-core": "^6.26.3", | ||
"babel-preset-env": "^1.7.0", | ||
"babelify": "^8.0.0", | ||
"browserify": "^16.2.2", | ||
"eslint": "^5.2.0", | ||
"uglify-es": "^3.3.9", | ||
"watchify": "^3.11.0" | ||
}, | ||
"bugs": { | ||
@@ -27,0 +46,0 @@ "url": "https://github.com/papb/jsonify-error/issues" |
@@ -6,20 +6,32 @@ jsonify-error | ||
[![NPM version][npm-version-image]][npm-url] | ||
[![Dependency Status](https://david-dm.org/papb/jsonify-error.svg)](https://david-dm.org/papb/jsonify-error) | ||
[![MIT License][license-image]][license-url] | ||
[![NPM downloads][npm-downloads-image]][npm-url] | ||
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://github.com/papb/jsonify-error/issues) | ||
[![NPM version][npm-version-badge]][npm-url] | ||
[![License][license-badge]][license-url] | ||
[![NPM downloads][npm-downloads-badge]][npm-url] | ||
[![Dependency Status][dependency-status-badge]](https://david-dm.org/papb/jsonify-error) | ||
[![Dev Dependency Status][dev-dependency-status-badge]](https://david-dm.org/papb/jsonify-error) | ||
[![contributions welcome][contrib-welcome-badge]](https://github.com/papb/jsonify-error/issues) | ||
It's 2018 and neither `JSON.stringify(x)` nor `console.log(x)` behave as nicely as they could when `x` is an error. | ||
It's 2018 and neither `JSON.stringify(e)` nor `console.log(e)` behave as nicely as they could when `e` is an error. | ||
With **jsonify-error**, use `jsonifyError(x)` instead of `x`. It produces a plain object with everything one could wish to see about an error. | ||
With **jsonify-error**, use `jsonifyError(e)` instead of `e`. It produces a plain object with everything one could wish to see about an error. | ||
# Installation | ||
For browsers, simply include browser.js in your entry point: | ||
## In Browsers | ||
For browsers, simply include one of the dists in your entry point, such as `dist/jsonify-error.js`: | ||
```html | ||
<script src="https://rawgit.com/papb/jsonify-error/1.1.1/browser.js" integrity="sha384-OP9ezJvZ76f15Peimd7ytooizwOs3thcuSX5kOzC+lAh94CA8G3PRrP8DnXf4Ch8" crossorigin="anonymous"></script> | ||
<script src="https://rawgit.com/papb/jsonify-error/1.1.2/dist/jsonify-error.js" integrity="sha384-rUJqVIJ9yTjx2QW03SzS3uxW2wPyXET6UMl7Wm6/jFeHbEIJ3xEudBqnLekQVFRi" crossorigin="anonymous"></script> | ||
``` | ||
The following dists are available: | ||
* `dist/jsonify-error.js` | ||
* `dist/jsonify-error.min.js` | ||
* `dist/jsonify-error.es5.js` | ||
* `dist/jsonify-error.es5.min.js` | ||
## In Node | ||
In node, as usual, simply do: | ||
@@ -116,11 +128,13 @@ | ||
MIT - Pedro Augusto de Paula Barbosa | ||
MIT (c) Pedro Augusto de Paula Barbosa | ||
[npm-url]: https://npmjs.org/package/jsonify-error | ||
[npm-version-image]: https://img.shields.io/npm/v/jsonify-error.svg | ||
[npm-downloads-image]: https://img.shields.io/npm/dt/jsonify-error.svg | ||
[npm-version-badge]: https://badgen.net/npm/v/jsonify-error | ||
[dependency-status-badge]: https://badgen.net/david/dep/papb/jsonify-error | ||
[dev-dependency-status-badge]: https://badgen.net/david/dev/papb/jsonify-error | ||
[npm-downloads-badge]: https://badgen.net/npm/dt/jsonify-error | ||
[contrib-welcome-badge]: https://badgen.net/badge/contributions/welcome/green | ||
[license-badge]: https://badgen.net/npm/license/jsonify-error | ||
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg | ||
[license-url]: LICENSE | ||
[better-promise-error-log]: https://npmjs.org/package/better-promise-error-log |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
138
0
9751
7
6
48