Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@emoji-gen/ptero
Advanced tools
:deciduous_tree: Simple CustomEvent listener and emitter
$ npm install @emoji-gen/ptero --save # for npm users
$ yarn add @emoji-gen/ptero # for yarn users
import { Ptero } from '@emoji-gen/ptero'
const ptero = new Ptero()
ptero.on('eventname', e => {
console.log(e.detail) // => { foo: 1 }
})
ptero.emit('eventname', { foo: 1 })
new Ptero(target)
Create new Ptero
instance.
// Default target is `window`
const ptero = new Ptero()
// Set `document.body` for an event target
const ptero = new Ptero(document.body)
ptero.addListener(event, listener)
Listen a single custom event.
ptero.addListener('eventname', e => {
console.log(e.detail)
})
ptero.on(event, listener)
Listen a single custom event or multi custom events.
ptero.on('eventname', e => {
console.log(e.detail)
})
ptero.on(['eventname1', 'eventname2'], e => {
console.log(e.detail)
})
ptero.removeListener(event, listener)
Stop listening a single custom event.
const listener = e => {
console.log(e.detail)
}
ptero.addListener('eventname', listener)
ptero.removeListener('eventname', listener)
ptero.off(event, listener)
Stop listening a single custom event or multi custom events.
const listener = e => {
console.log(e.detail)
}
ptero.on('eventname1', listener)
ptero.on(['eventname2', 'eventname3'], listener)
ptero.off('eventname1', listener)
ptero.off(['eventname2', 'eventname3'], listener)
ptero.emit(event, detail)
Dispatch a single custom event.
ptero.emit('eventname', { foo: 1 })
$ yarn start # for development
$ yarn run build # for production
$ yarn test # run tests
MIT © Emoji Generator
FAQs
Simple CustomEvent listener and emitter
We found that @emoji-gen/ptero 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.