Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@libp2p/interfaces
Advanced tools
Common code shared by the various libp2p interfaces
$ npm i @libp2p/interfaces
Throw an error with a .code
property of 'ABORT_ERR'
:
import { AbortError } from '@libp2p/interfaces/errors'
throw new AbortError()
Typed events:
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
export interface MyEmitterEvents {
'some-event': CustomEvent<number>;
}
class MyEmitter extends EventEmitter<MyEmitterEvents> {
}
// later
const myEmitter = new MyEmitter()
myEmitter.addEventListener('some-event', (evt) => {
const num = evt.detail // <-- inferred as number
})
import type { AbortOptions } from '@libp2p/interfaces'
Lifecycles for components
import { start, stop, isStartable } from '@libp2p/interfaces/startable'
import type { Startable } from '@libp2p/interfaces/startable'
class MyStartable implements Startable {
// .. implementation methods
}
const myStartable = new MyStartable()
isStartable(myStartable) // returns true
await start(myStartable)
await stop(myStartable)
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
FAQs
Common code shared by the various libp2p interfaces
The npm package @libp2p/interfaces receives a total of 48,651 weekly downloads. As such, @libp2p/interfaces popularity was classified as popular.
We found that @libp2p/interfaces demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.