Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@hscmap/event-emitter
Advanced tools
EventEmitter for TypeScript
npm install --save @hscmap/event-emitter
import { EventEmitter } from '@hscmap/event-emitter'
class MyEvent1 {
constructor(readonly message: string) { }
}
class MyEvent2 {
constructor(readonly message: string) { }
}
const ee = new EventEmitter()
const off1 = ee.on(MyEvent1, e => {
throw e
})
ee.on(MyEvent2, e => {
throw e
})
try {
ee.emit(new MyEvent2('hello'))
throw new Error()
}
catch (e) {
console.assert(e instanceof MyEvent2)
console.assert(e.message == 'hello')
}
try {
ee.emit(new MyEvent1('world'))
throw new Error()
}
catch (e) {
console.assert(e instanceof MyEvent1)
console.assert(e.message == 'world')
}
off1()
try {
ee.emit(new MyEvent1('hello'))
throw new Error('no handler fired')
}
catch (e) {
console.assert(e instanceof Error && e.message == 'no handler fired')
}
FAQs
EventEmitter for TypeScript
We found that @hscmap/event-emitter 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.