Modules@robinpath/event
@robinpath/event
0.1.0PublicPub/sub event emitter for RobinPath automation workflows
@robinpath/event
Pub/sub event system with named buses, listener management, history, and async waitFor
Why use this module?
The event module lets you:
- Create a named event bus with an optional max listener limit
- Subscribe a listener to an event on a named bus
- Subscribe a one-time listener that automatically removes itself after firing
- Remove a listener, all listeners for an event, or all listeners on the bus
- Emit an event with optional data, notifying all subscribed listeners
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/event
Quick Start
No credentials needed — start using it right away:
event.on "workflow" "task.completed" $handler
Available Functions
| Function | Description |
|---|---|
event.create | Create a named event bus with an optional max listener limit |
event.on | Subscribe a listener to an event on a named bus |
event.once | Subscribe a one-time listener that automatically removes itself after firing |
event.off | Remove a listener, all listeners for an event, or all listeners on the bus |
event.emit | Emit an event with optional data, notifying all subscribed listeners |
event.listenerCount | Get the number of listeners for a specific event or all events on a bus |
event.eventNames | List all event names that have listeners on a bus |
event.removeAll | Remove all listeners from all events on a bus |
event.history | Get the emission history for a bus, optionally filtered by event name |
event.waitFor | Wait for a specific event to be emitted, with a timeout |
event.destroy | Destroy a named event bus and free all resources |
Examples
Subscribe a listener to an event on a named bus
event.on "workflow" "task.completed" $handler
Subscribe a one-time listener that automatically removes itself after firing
event.once "workflow" "done" $handler
Remove a listener, all listeners for an event, or all listeners on the bus
event.off "workflow" "task.completed"
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/event";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
event.on "workflow" "task.completed" $handler
`);
Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.0 | latest | yesterday |
Related Modules
devops
0
@robinpath/bitbucket
v0.1.1robinpath
Bitbucket module for RobinPath.
0 downloads
...
devops
0
@robinpath/box
v0.1.1robinpath
Box module for RobinPath.
0 downloads
...
devops
0
@robinpath/cache
v0.1.1robinpath
In-memory key-value cache with optional TTL expiration for temporary data storage
0 downloads
...
devops
0
@robinpath/cloudflare
v0.1.1robinpath
Cloudflare module for RobinPath.
0 downloads
...
Install
$ robinpath install @robinpath/event Version0.1.0
LicenseMIT
Unpacked Size5.5 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

