1.1.3 • Published 7 years ago

msg-notify v1.1.3

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

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