msg-notify

1.1.3 • Public • Published

msg-notify

npm:

Display notifications to your app

Online Demo

msg-notify

Installation

npm install --save msg-notify

Usage

First import msg-notify/lib/notify.styl or msg-notify/dist/notify.css, then

// import 'msg-notify/dist/notify.css' // import style first
import notify from 'msg-notify'
 
notify('notification msg', 'success')
notify('error msg', 'error')

API

notify(config)

  • config {object} - the config object
  • config.msg {string} - notification msg
  • [config.type = 'error'] {stirng} - notify type: default error, or success, info, warning,
  • [config.timeout = 2] {number} - timeout to hide (in seconds)
  • [config.position = 'tc'] {string} - position: default 'tc'(top center), or 'tl'(top left), 'tr'(top right)

notify(msg[, type='error'[, timeout=2[, position='tc']]])

License

MIT

Package Sidebar

Install

npm i msg-notify

Weekly Downloads

6

Version

1.1.3

License

ISC

Last publish

Collaborators

  • brook