usergrid-counters

0.0.7 • Public • Published

usergrid-counters

A Node.js package to work with usergrid counter/events.

Version

0.0.1

Installation

npm i usergrid-counter

Methods

Create an event

You can create an event by setting the counter's name or an array to create multiple at the same time ('counterName' or ['counterName1', 'counterName2', ...]).

createEvent(counterName)

Get counter

getCounter(counterName)

Get counter by time interval

interval = {
  start_time: timeStamp,
  end_time: timeStamp,
  resolution: 'all'|'minute'|'five_minutes'|'half_hour'|'hour'|'six_day'|'day'|'week'|'month'
}
 
getCounterInterval(counterName, interval)

Increment/Decrease counter

increment could be positive (to increment), negative (to decrease) or 0 to reset counter

incrementCounter(counterName, increment)

Reset counter

Short method for incrementCounter(counterName, 0)

resetCounter(counterName)

install

npm i usergrid-counters

Downloadsweekly downloads

2

version

0.0.7

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability