Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/notify-events/nodejs
Node.js module to integrate your project with Notify.Events service.
https://github.com/notify-events/nodejs
alert call node-js notification slack teams telegram viber voice
Last synced: about 1 month ago
JSON representation
Node.js module to integrate your project with Notify.Events service.
- Host: GitHub
- URL: https://github.com/notify-events/nodejs
- Owner: notify-events
- License: mit
- Created: 2020-07-04T06:52:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-10T02:56:24.000Z (about 1 year ago)
- Last Synced: 2024-12-06T00:09:55.910Z (2 months ago)
- Topics: alert, call, node-js, notification, slack, teams, telegram, viber, voice
- Language: JavaScript
- Homepage: https://notify.events/source/78
- Size: 46.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node.js client for Notify.Events
A simple node.js extension that simplifies the process of integrating your project with the [Notify.Events](https://notify.events) service to send messages to your channels.
#### Instruction in other languages
- [Русский](/docs/ru-RU/README.md)
# Installation
The preferred way to install this extension is through [npm](https://www.npmjs.com/get-npm).
Either run
```
npm install @notify.events/nodejs
```or add
```
"@notify.events/nodejs": "~1.0"
```to the dependencies section of your package.json.
# Usage
To use this extension, you need to import the Message class into your Node.js script.
If you have used npm for installation, it will be enough to include lib like this:
```nodejs
const Message = require('@notify.events/nodejs').Message;
```Otherwise, if you added the lib manually, you need to import the Message by full path:
```nodejs
const Message = require('./path/to/your/Message');
```After that, you can create a message object, set the necessary parameters and send the message to the channel.
### Usage example
```nodejs
const Message = require('@notify.events/nodejs').Message;// Defining channel token.
// You get this token when creating a channel on the Notify.Events service.
const token = 'XXXXXXXX';// Create a message object.
const message = new Message('Some important message', 'Title', Message.PRIORITY_HIGH, Message.LEVEL_ERROR);// Attach the file to the message.
message.addFile('path\to\local\file');// Send a message to your channel in Notify.Events.
message.send(token);
```