
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
emit-listenner
Advanced tools
emit-listenner is a slim EventEmitter implementation based on ESM.
NOTE: Please ensure your nodejs version is great than 12.17!
npm install --save emit-listenner
// foo.js
import emitListenner from 'emit-listenner'
const event = new emitListenner.EventEmitter()
event.addListenner("eventname", callback); // register a listenner
event.emit("eventname", {
a: 'some args'
}); // emit event
emit-listenner
is a module based on ES-module, if you want use it in Nodejs with CommonJS pattern, you can use dynamic import
expression that is a nodejs new feature that used to import ES module in Commonjs module. But if you do this, make sure your nodejs version is great than v12.13!
// foo.cjs
(async ()=>{
const { EventEmitter } = await import('emit-listenner')
const ev = new EventEmitter()
ev.addListenners([
{
name: "change",
handler: args=>console.log(args),
once: true
}
])
})
Register a listenner for certain specified event, when event trigged them will be called orderly.
Register multiple events at once. the events
is an array of structure like below:
{
name: string; // event name
handler: args=>any; // it will be called when event is triggered
once?: boolean; // same as `EventEmitter#once`, default false
}
Alias of EventEmitter#removeListenner
Alias of EventEmitter#addListenner
Register a listenner for certain specified event, but just only effects one time.
Note: Register a same event continuously for the same time, and the latter will overwrite the former
Remove specified listenner for the specified event, but will remove all listenners of name
event when handler is not set.
Remove all registered events and its listenners.
Get count of listenners of specified event.
Emit a event with optional arguments.
alias of EventEmitter#emit
.
MIT.
FAQs
slim EventEmitter implementation
The npm package emit-listenner receives a total of 1 weekly downloads. As such, emit-listenner popularity was classified as not popular.
We found that emit-listenner 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
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.