tophat

1.0.3 • Public • Published

Top Hat

Top Hat is a minimal wrapper for the StatHat EZ API.

Installation

npm install tophat

Example

var tophat = require('tophat'),
    stats = new tophat('EZ_KEY');

stats.count('login.success'); // Count 1 successful login
stats.count('login.failed', 2); // Count 2 failed logins

stats.value('users.active', 100); // Record 100 active users

Constructor options

  • key: StatHat EZ key, found on the Settings page
  • options: optional options object with the following keys
    • prefix: prefix for stat name
    • ssl: boolean specifying transport, defaults to true

Methods

.count(name, count, cb)

  • name: Stat name
  • count: Optional count, defaults to 1
  • cb: Optional callback function

.value(name, value, cb)

  • name: Stat name
  • value: Stat value
  • cb: Optional callback function

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    4
  • 1.0.2
    2
  • 1.0.1
    2
  • 1.0.0
    2

Package Sidebar

Install

npm i tophat

Weekly Downloads

8

Version

1.0.3

License

none

Last publish

Collaborators

  • davidwood