Socket
Socket
Sign inDemoInstall

jsonify-error

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonify-error - npm Package Compare versions

Comparing version 1.4.3 to 1.4.4

7

CHANGELOG.md

@@ -9,2 +9,6 @@ # Changelog

## [1.4.4] - 2019-02-11
### Changed
- Improved README
## [1.4.3] - 2019-01-13

@@ -85,3 +89,4 @@ ### Added

[Unreleased]: https://github.com/papb/jsonify-error/compare/v1.4.3...HEAD
[Unreleased]: https://github.com/papb/jsonify-error/compare/v1.4.4...HEAD
[1.4.4]: https://github.com/papb/jsonify-error/compare/v1.4.3...v1.4.4
[1.4.3]: https://github.com/papb/jsonify-error/compare/v1.4.2...v1.4.3

@@ -88,0 +93,0 @@ [1.4.2]: https://github.com/papb/jsonify-error/compare/v1.4.1...v1.4.2

2

package.json
{
"name": "jsonify-error",
"version": "1.4.3",
"version": "1.4.4",
"description": "Convert errors to JSON or to a good string. Develop faster with better error messages.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -20,14 +20,11 @@ jsonify-error

It's 2018 and still the default behavior of JavaScript could be better with regard to displaying errors:
It's 2019 and still the default behavior of JavaScript could be better with regard to displaying/manipulating errors:
* `console.log(e)`: Bad
* `JSON.stringify(e)`: Bad
* `e.toString()`: Bad
* `e.toJSON()`: Doesn't exist
* `console.log(e)`: Bad in browsers, not so bad in Node but could be better
But **jsonify-error** comes to the rescue:
* For `console.log(e)`:
* Use `jsonifyError.log(e)` instead
* Or call `jsonifyError.overrideConsole()` once and then `console.log(e)` will work.
* For `JSON.stringify(e)`:

@@ -42,2 +39,5 @@ * Use `JSON.stringify(jsonifyError(e))` instead

* Or call `jsonifyError.overrideErrorMethods()` once and then `e.toJSON()` will work.
* For `console.log(e)`:
* Use `jsonifyError.log(e)` instead
* Or call `jsonifyError.overrideConsole()` once and then `console.log(e)` will work.

@@ -51,3 +51,3 @@ # Installation

```html
<script src="https://cdn.jsdelivr.net/npm/jsonify-error@1.4.3/dist/jsonify-error.min.js" integrity="sha384-LMhRr720pxeJYAdoD1KzPKuIISdSOxXtm03dhjkQzUqkCpyxEbSkeVEsEpfgU9ss" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jsonify-error@1.4.4/dist/jsonify-error.min.js" integrity="sha384-LMhRr720pxeJYAdoD1KzPKuIISdSOxXtm03dhjkQzUqkCpyxEbSkeVEsEpfgU9ss" crossorigin="anonymous"></script>
```

@@ -102,3 +102,3 @@

If you're thinking *"Great! Now I can do `console.log(jsonifyError(e))` instead of `console.log(e)`"*, you're in the right track, but you can do even better!
If you're thinking *"Great! Now I can do `console.log(jsonifyError(e))` instead of `console.log(e)`" in a browser*, you're in the right track, but you can do even better!
A few utility methods are exposed by **jsonifyError** beyond the main one, as mentioned in the beginning of this README.

@@ -105,0 +105,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc