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

despot

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

despot

A global event bus driven by a singleton event emitter class that also works on silly browsers ... IE.

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

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

Despot

A global event bus driven by a singleton event emitter class. Use this module to hook something in other objects.

Originally forked from https://github.com/teawithfruit/node-singleton-event with the difference that it also works on silly browsers ... IE.

Beware it's very controversial to have a singleton acting as an event emitter. Depends on your app architecture. The fact that nodejs/iojs caches any module.exports makes it easy to build one. IMO it's useful for rapid prototyping but not recommended for high performance apps.

Install

npm i -S despot

How to use

Require it in every file where you want to communicate with another file.

Say something:

var despot = require("despot");
despot.emit("talk", "hello world");

Receive something:

var despot = require("despot");
despot.on("talk", function (value) {
  console.log(value);
});

Keywords

FAQs

Package last updated on 10 Sep 2024

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