Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

exceptional

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exceptional

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

exceptional

Fantastic error messages for Node. This module is still very experimental and you might experience great frustration if the exceptional error handler fails. You'll have to debug exceptional itself in that case...

Example

The output is colored too. I'll embed an image here sometime but here's what it looks like uncolored:

ReferenceError: nonexistentFunc is not defined
/Users/abi/stuff/repos/node/exceptional/examples/example.js
	1: (function() {
	2:   var a;
	3:   require('../lib/exceptional');
	4:   a = 5;
	5:  >nonexistentFunc();
	6:   a();
	7: }).call(this);
/Users/abi/stuff/repos/node/exceptional/examples/example.js
	2:   var a;
	3:   require('../lib/exceptional');
	4:   a = 5;
	5:   nonexistentFunc();
	6:   a();
	7: })>call(this);
Module._compile (module.js:402:26)
Object..js (module.js:408:10)
Module.load (module.js:334:31)
Function._load (module.js:293:12)
Array.<anonymous> (module.js:421:10)
EventEmitter._tickCallback (node.js:126:26)

Usage

npm install exceptional

And in your node module that you are debugging,

require 'exceptional'

Notes about Coffee use

Using this directly with the Coffee executable is a bad idea because this depends on the node process emitting the uncaughtException which happens to be handled by the Coffee executable directly. See this Stack Overflow question for details. You can of course do this instead,

coffee -c x.coffee && node x.js

This is what I do currently.

TODO

  • Re-write all code (it's really ugly right now)
  • Figure out a better color scheme
  • Handle other kinds of special errors like we're handling AssertionError right now
  • Figure out how muliple imports/requires will be handled
  • Write some tests
  • Relative paths
  • Make sure it works correctly with bugs in imported modules

FAQs

Package last updated on 18 Sep 2011

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