Socket
Socket
Sign inDemoInstall

domain-browser

Package Overview
Dependencies
0
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

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.


Version published
Maintainers
1
Weekly downloads
6,880,840
decreased by-17.42%
Install size
30.0 kB

Weekly downloads

Package description

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

Readme

Source

domain-browser

Status of the GitHub Workflow: bevry NPM version NPM downloads
GitHub Sponsors donate button ThanksDev donate button Patreon donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button
Discord server badge Twitch community badge

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

Install

npm

  • Install: npm install --save domain-browser
  • Import: import * as pkg from ('domain-browser')
  • Require: const pkg = require('domain-browser')

jspm

<script type="module">
    import * as pkg from '//dev.jspm.io/domain-browser@5.7.0'
</script>

Editions

This package is published with the following editions:

  • domain-browser aliases domain-browser/source/index.js
  • domain-browser/source/index.js is ES5 source code for web browsers and Node.js 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules

History

Discover the release history by heading on over to the HISTORY.md file.

Backers

Code

Discover how to contribute via the CONTRIBUTING.md file.

Authors
Maintainers
Contributors

Finances

GitHub Sponsors donate button ThanksDev donate button Patreon donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button

Sponsors
  • Andrew Nesbitt — Software engineer and researcher
  • Balsa — We're Balsa, and we're building tools for builders.
  • Codecov — Empower developers with tools to improve code quality and testing.
  • Poonacha Medappa
  • Rob Morris
  • Sentry — Real-time crash reporting for your web apps, mobile apps, and games.
  • Syntax — Syntax Podcast
Donors

License

Unless stated otherwise all works are:

and licensed under:

Keywords

FAQs

Last updated on 29 Dec 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc