Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
choo-hooks
Advanced tools
Hook into Choo's events and timings. Useful to create loggers, analytics and more.
var Hooks = require('choo-hooks')
var choo = require('choo')
var app = choo()
app.use(function (state, emitter) {
var hooks = Hooks(emitter)
hooks.on('event', function (eventName, timing, data) {
console.log(eventName + ':', timing.duration + 'ms', data)
})
hooks.on('unhandled', function (eventName, data) {
console.error('No listeners for ' + eventName)
})
})
Create a new Choo Hooks instance.
hook.on('log:trace', cb(…args))
hook.on('log:debug', cb(…args))
hook.on('log:info', cb(…args))
hook.on('log:warn', cb(…args))
hook.on('log:error', cb(…args))
hook.on('log:fatal', cb(…args))
Listen for log events.
hook.on('service-worker', cb(data))
Listen for service worker event.
hook.on('event', cb(eventName, timing, data))
Called for events implemented at the application layer.
hook.on('unhandled', cb(eventName, data))
Called whenever an event is emitted, and there is no handler available.
hook.on('DOMContentLoaded', cb(timing))
Called whenever the DOM has loaded. Returns the window.performance.timing
object.
hook.on('render', cb(timings))
Called whenever Choo renders. Returns an object with the render
and morph
properties.
hook.on('resourceTimingBufferFull', cb())
Called whenever the browser's resource timing buffer has filled up.
FAQs
Hook into Choo's events and timings
The npm package choo-hooks receives a total of 27 weekly downloads. As such, choo-hooks popularity was classified as not popular.
We found that choo-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 27 open source maintainers 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.