multivents is a small yet flexible, multifunctional pub-sub library. It allows you to create event channels, send (asynchronous) events over those channels and subscribe to events.
If you want to get started quickly, here is a basic example of how to use multivents:
var Channel = ;var myChannel = ;myChannel;myChannel; // 'hello world'
If that's all you wanted to know, great! If not, you may read on to find out more.
You can also install it via
npm install multivents
If you want to extend multivents to your needs, you might want to run tests. In order to do this, you can clone this repository and run
npm install and
npm test. Tests are written with assert and run with mocha.
Multivents aims to be a highly flexible, multifunctional library that can be used in projects of all sizes. It tries to be as small and fast as possible while offering you all the semantics for event systems that you could wish for. multivents mainly wants to get out of your way and attempts that by providing a straightforward API that includes a lot of optional parameters. The goal is for you to use multivents the way you want to, and not to be limited by the library's opinions.
This README and all the documentation use a couple of terms synonymously: "event" and "message" are the same as well as event "name" and event "type". "Listening for an event", "adding a callback" and "subscribing to an event" all refer to the process of registering a function to be executed when an event is "emitted" / "triggered" / "fired".