JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1938538
  • Score
    100M100P100Q192031F
  • License MIT

Namespaced global event emitter

Package Exports

  • sparkles

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sparkles) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sparkles

Build Status

Namespaced global event emitter

Usage

Sparkles exports a function that returns a singleton EventEmitter. This EE can be shared across your application, whether or not node loads multiple copies.

var sparkles = require('sparkles')(); // make sure to call the function

sparkles.on('my-event', function(evt){
  console.log('my-event handled', evt);
});

sparkles.emit('my-event', { my: 'event' });

License

MIT