Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/norjs/event
NorJS Event Library
https://github.com/norjs/event
events observer
Last synced: 25 days ago
JSON representation
NorJS Event Library
- Host: GitHub
- URL: https://github.com/norjs/event
- Owner: norjs
- License: mit
- Created: 2019-03-29T17:38:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:35:43.000Z (almost 2 years ago)
- Last Synced: 2024-11-11T10:37:52.657Z (about 1 month ago)
- Topics: events, observer
- Language: JavaScript
- Homepage:
- Size: 123 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NorJS Event Observer Library
This is a library which implements an interface to trigger and listen events from
[The NorJS Event Service](https://github.com/norjs/event-service).### Design
It is a NodeJS library which can connect to a local event service running on the system and through
it possibly connect to multiple top level event servers and services running on other systems.Communication between the library and local service is implemented using long polling HTTP over
local UNIX socket file.### Install
`npm install @norjs/event`
### Usage
### Command line usage
Wait for an event:
```
if NODE_CONNECT=/path/to/socket.sock nor-event --wait=foo; then
echo Event happened
else
echo Timeout happened
fi
```Trigger an event:
```
NODE_CONNECT=/path/to/socket.sock nor-event --trigger=foo --payload='{"hello":"world"}'
```