
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@atxmtx/metrics
Advanced tools
Google Analytics event tracking for Atom packages
npm install @atxmtx/metrics -S
Once the Metrics class has been instantiated, events can be fired from anywhere in your package.
// JavaScript
import Metrics from '@atxmtx/metrics';
export async function activate() {
const ga = new Metrics('UA-XXXX-Y');
ga.event({
category: 'Demo',
action: 'Package activated!'
});
};
# CoffeeScript
const Metrics = require "@atxmtx/metrics"
module.exports =
activate: () ->
ga = new Metrics("UA-XXXX-Y");
ga.event {
category: "Demo"
action: "Package activated!"
}
Command metrics allow simple tracking of invoked package commands. In the following example, all commands provided by the settings-view
package will be tracked by Google Analytics.
// JavaScript
import Metrics from '@atxmtx/metrics';
export async function activate() {
new Metrics('UA-XXXX-Y', {
commandCategory: 'Settings View Commands',
commandAction: [
'settings-view:*'
]
});
};
# CoffeeScript
const Metrics = require "@atxmtx/metrics"
module.exports =
activate: () ->
new Metrics('UA-XXXX-Y',
commandCategory: 'Settings View Commands'
commandAction: [
'settings-view:*'
])
Usage: new Metrics(trackingID: string, options: object)
Instantiates class and adds event listeners, unless option.muted
is used
Usage: listen()
Manuall add event listener, e.g. for when option.muted
is true
Usage: mute()
Removes event listener
Usage: event({ category: string, action: string, label?: string, value?: number})
Sends an event to Google Analystics
Type: string | string[]
Used to track specified package commands, supports wildcards (e.g. my-package:*
).
Type: string
Default: Package Command
Default event category for package commands.
Type: boolean
Default: false
Used to send a random number in GET requests to ensure browsers and proxies don't cache hits.
Type: boolean
Default: false
Skips add event listeners when the class is instantiated.
This work is dual-licensed under The MIT License and the GNU General Public License, version 2.0
FAQs
Google Analytics event tracking for Atom packages
The npm package @atxmtx/metrics receives a total of 12 weekly downloads. As such, @atxmtx/metrics popularity was classified as not popular.
We found that @atxmtx/metrics 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.