Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@webgap/notifier

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webgap/notifier

Notifications Manager.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

README

This is a WebGAP Notifications Management module.
Handles abstraction for multiple notification mechanisms.

Dependencies

Handles logging using @webgap/logger.
Handles objects using @webgap/object-utils.
Handles date format using @webgap/format-utils.
Loads default configuration using @webgap/configuration.
Generates IDs using node-uuid.
Handles Strings using string.

Requirements

A configuration file must exist (check @webgap/configuration documentation).

API

Installation

npm install @webgap/notifier --save

Usage

var Notifier = require('@webgap/notifier').Notifier,
    Notification = Notifier.Notification,
    Message = Notification.Message,
    notifier = new Notifier();
// create Email Notification System Class 
function EmailSystem() {}
// EmailSystem must implement a notify function
EmailSystem.prototype.notify = function (options) {
  console.log('\nEmail system send message: ' + JSON.stringify(options.notification));
};
// register the system
notifier.register('EMAIL', EmailSystem);
// set a default system for most common notification mechanism
notifier.setDefaultNotificationSystem({notificationSystem: notifier.systems.EMAIL});
// create notification
var notification = new Notification({
  userId: 'id of the user to notify', 
  message: new Message({
    key: 'messages.error.text',
    data: { errorCode: 111 }
  })
});
// notify
notifier.notify({notification: notification}, function callback(err) {err && console.log(err);});

License

Apache License, Version 2.0

Keywords

FAQs

Package last updated on 30 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc