Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Javascript event emitter, foundation of everything.
Dot-event provides a succinct interface for calling events and persisting state with a tiny footprint (<1kb).
const dot = require("dot-event")()
dot.on(() => {}) // listener
dot() // emitter
dot.on(() => "a")
dot() // "a"
dot.on(async () => "a")
dot().then(result => /* [ "a" ] */)
dot.on("a", () => "b")
dot("a") // "b"
Event id tip: The first string or element in an array of strings passed to dot.on
or dot.any
is considered the event id.
dot.on("a", "b", "c", prop => prop)
dot("a", "b", "c") // ["b", "c"]
Prop tip 1: Any string or array of strings passed to dot
after the event id are considered prop identifiers.
Prop tip 2: The listener function always receives a prop array as its first argument.
dot.on((prop, arg) => arg)
dot({ a: "b" }) // { a: "b" }
Arg tip 1: The last non-prop emit argument is considered the user-provided argument.
Arg tip 2: The listener function always receives the user-provided argument as its second argument.
dot.any(() => "!!!")
dot("a", "b", "c") // "!!!"
dot.any("a", props => props)
dot.a("b", "c") // [ "b", "c" ]
Helper tip: Dot-event creates a helper function only if dot.any
receives an event id with no props.
No matter what is passed to the dot
emitter, listener functions always receive five arguments:
prop
— an array of string identifiersarg
— a user-provided argumentdot
— the dot-event instanceevent
— the event idsignal
— dot-event signal object (use signal.cancel = true
for event cancellation)Library | Description | URL |
---|---|---|
ad | Google Publisher Tag functions | https://github.com/dot-event/ad |
arg | CLI and URL argument handling | https://github.com/dot-event/arg |
fetch | Universal HTTP fetch function | https://github.com/dot-event/fetch |
log | Log functions | https://github.com/dot-event/log2 |
store | Immutable store | https://github.com/dot-event/store2 |
FAQs
Powerful event emitter
The npm package dot-event receives a total of 90 weekly downloads. As such, dot-event popularity was classified as not popular.
We found that dot-event 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.