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

error-trap

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

error-trap

This module automatically injects code into every HTML page that makes a WebSocket connection back to the server and sends the server information about any uncaught errors. It hooks into browser functionality such as addEventListener() and setTimeout() to get complete stack traces but falls back to a window.onerror handler so it doesn't miss anything.

  • 0.1.0
  • latest
  • npm
  • Socket score

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

Real-time Error Trap

This module automatically injects code into every HTML page that makes a WebSocket connection back to the server and sends the server information about any uncaught errors. It hooks into browser functionality such as addEventListener() and setTimeout() to get complete stack traces but falls back to a window.onerror handler so it doesn't miss anything.

Usage

var errorTrap = require('error-trap');
var connect = require('connect');
var app = connect();
var server = require('http').createServer(app);

app.use(errorTrap({
  server: server,
  onerror: function(message) {
    console.log({
      text: message.text,
      date: new Date(message.time),
      method: message.method
    });
  }
}));
app.use(connect.static('www'));
server.listen(8000);

FAQs

Package last updated on 16 Jul 2013

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