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

domain-browser

Package Overview
Dependencies
Maintainers
4
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domain-browser

Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more.

  • 2.0.0-next.1574630902.fc1a8168b8277434656bee6dbf6c762442480e7b
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9M
decreased by-62.77%
Maintainers
4
Weekly downloads
 
Created

What is domain-browser?

The domain-browser package is a shim for Node.js's domain module, which allows you to handle multiple different IO operations as a single group. This is particularly useful in the context of handling errors across asynchronous operations. The package provides a way to group and handle errors and cleanup resources in client-side JavaScript that mimics Node.js's domain module functionality.

What are domain-browser's main functionalities?

Error Handling

This feature allows grouping of IO operations and handling errors that occur within that group. The code sample demonstrates creating a domain, setting up an error handler, and running a function that throws an error asynchronously.

var domain = require('domain-browser');
var d = domain.create();
d.on('error', function(err) {
  console.error('Caught error!', err);
});
d.run(function() {
  setTimeout(function() {
    throw new Error('Failed!');
  }, 1000);
});

Other packages similar to domain-browser

Keywords

FAQs

Package last updated on 24 Nov 2019

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