New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

oberr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oberr

Turns errors into an object that can be stringified

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

oberr

Turns a JS Error into a proper object that can be stringified

Usage

Before

var myError = new Error("Something broke");
var myObject = {
    err: myError
}
JSON.stringify(myObject);
//=> {err: {}} // WTF

After

var oberr = require("oberr");

var myError = new Error("Something broke");
var myObject = {
    err: oberr(myError)
}
JSON.stringify(myObject);
//=> {err: {message: "Something broke", code: 0, stack: ""}} // Yay! 

License

MIT

Keywords

FAQs

Package last updated on 25 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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