Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
usage-stats
Advanced tools
A minimal Google Analytics Measurement Protocol client for tracking usage statistics in node.js apps.
const UsageStats = require('usage-stats')
const usageStats = new UsageStats({
appName: 'sick app',
version: '1.0.0',
tid: 'UA-98765432-1'
})
// start a new session
usageStats.start()
// user set an option..
usageStats.event('option', 'verbose-level', 'infinite')
// app is running in 'encoding' mode..
usageStats.screenView('encoding')
// finished, send stats and mark the session as complete
usageStats.send().end()
Example
const UsageStats = require('usage-stats')
Param | Type | Description |
---|---|---|
[options] | object | |
[options.appName] | string | App name |
[options.version] | string | App version |
Starts the session.
Kind: instance method of UsageStats
Chainable
Ends the session.
Kind: instance method of UsageStats
Chainable
Disable the module. While disabled, all operations are no-ops.
Kind: instance method of UsageStats
Chainable
Re-enable the module.
Kind: instance method of UsageStats
Chainable
Track an event. All event hits are queued until .send()
is called.
Kind: instance method of UsageStats
Chainable
Param | Type | Description |
---|---|---|
category | string | Event category |
action | string | Event action |
[label] | string | Event label |
[value] | string | Event value |
Track a screenview. All screenview hits are queued until .send()
is called.
Kind: instance method of UsageStats
Chainable
Param | Type | Description |
---|---|---|
name | string | Screen name |
Send queued hits. If offline, the hits will be stored and re-tried on next invocation.
Kind: instance method of UsageStats
Chainable
© 2016 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.
FAQs
A minimal, offline-friendly Google Analytics Measurement Protocol client for tracking statistics in shell and javascript applications
The npm package usage-stats receives a total of 1,382 weekly downloads. As such, usage-stats popularity was classified as popular.
We found that usage-stats demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.