
Extension Bus
Universal message bus for web extensions
Overview
Extension Bus provides cross-process messaging with an intuitive, API-like interface.
Create a bus in one process:
const bus = createBus({
say: {
hello (payload) {
return `hello ${payload}!`
}
}
})Call it from another process:
const bus = createBus({ ... })
const result = await bus.call('say/hello', 'world')Key Features
This package provides an elegant solution, with:
- simple cross-process messaging
- named buses to easily target processes
- nested handlers with an API-like interface
- transparent handling of sync and async handlers
- transparent handling of process and handler errors
- transparent handling of internal and external calls
- a consistent interface for process, tab and external calls