0.0.2 • Published 11 years ago

notification-count v0.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
11 years ago

notification-count

Lightweight helper to keep track of notifications in your title (or your preferred element).

Demo

visual

browser support

Install

npm install notification-count

Api

var N = require('notification-count');

// create instance
// optional arguments:
// - count = default count
// - el = element to show the notifications, defaults to document.title
// - left = left separator, default to '('
// - right = right separator, default to ')'

var n = new N();

// add 1 or optional argument
n.add();

// subtract 1 or optional argument
n.subtract();

// set a specific value
n.set();

// set the initial value
// which is 0 or the value you chose yourself
n.default();