engined-notification

0.0.2 • Public • Published

engined-notification

Notification service for engined, used to send notification in backend.

Installation

Install via NPM:

npm install engined-notification

Usage

Start engined-notification service in engined, see example below:

const { Manager } = require('engined');
const NotificationService = require('engined-notification');

const notification = NotificationService();

const main = async () => {

	// Create manager
	let serviceManager = new Manager({ verbose: true });

	// Adding service to manager
	serviceManager.add('Notification', notification);

	// Start all services
	await serviceManager.startAll();
};

main();

Using specific notification backend

Here is example to get agent for specific backend to save file:

// Using local notification backend
let localAgent = this.getContext('Notification').getAgent('local');

Register notification backend

// Register notification backend
this.getContext('Notification').registerAgent('local', agent);

License

Licensed under the MIT License

Authors

Copyright(c) 2017 Leon Lin(林為志) <leonlin14@gmail.com>

Package Sidebar

Install

npm i engined-notification

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • leonlin14