Skip to content
/ notier Public

Simple promise enabled wrapper around notification library notie.

License

Notifications You must be signed in to change notification settings

dbtek/notier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notier

Simple promise enabled wrapper around notification library notie.

Install

$ npm i -S notier
# or
$ yarn add notier

Use

var notier = require('notier')

// general notifier
notier('Hi there!')

// success type notification
notier.success('Item acquired successfully')

// error type notification
notier.error('Could not find any results!' )

// confirm
notier.confirm('Are you sure? This cannot be undone.')
  .then(data => {
    // user accepted
  })
  .catch(() => {
    // user rejected
  })

API

notier(message, opts)
message is self explanatory. opts is notie options. Returns promise.

notier.info(message, opts)
Info type notification.

notier.success(message, opts)
Success type notification.

notier.warning(message, opts)
Warning type notification.

notier.error(message, opts)
Error type notification.

notier.confirm(message, opts)
Confirm notification. Returned promise will resolve on accept.

notier.setTexts({ submit, cancel })
Set global texts to be used in actions.

Author

Ismail Demirbilek - @dbtek

About

Simple promise enabled wrapper around notification library notie.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published