https://github.com/pouchlabs/pemitter
A blazing fast eventemitter for all js runtimes
https://github.com/pouchlabs/pemitter
browser bunjs deno eventemitter eventemitter3 events nodejs pubsub
Last synced: about 2 months ago
JSON representation
A blazing fast eventemitter for all js runtimes
- Host: GitHub
- URL: https://github.com/pouchlabs/pemitter
- Owner: pouchlabs
- License: mit
- Created: 2025-08-30T19:55:30.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-31T17:37:43.000Z (10 months ago)
- Last Synced: 2025-10-06T15:58:03.190Z (9 months ago)
- Topics: browser, bunjs, deno, eventemitter, eventemitter3, events, nodejs, pubsub
- Language: TypeScript
- Homepage: https://github.com/pouchlabs/pemitter#readme
- Size: 20.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# pemitter
A blazing fast eventemitter for all js runtimes
## Installation
```bash
bun add @pouchlab/emitter
```
## Usage
```typescript
import { Pemitter } from '@pouchlab/emitter';
const em = new Pemitter()
//once listener
em.once("chat",function cb(ev){
console.log("once",ev.data.get("h")())
})
//turns off listeners for current event
em.off("*") //alias removeListener
//listener
em.on("chat",(ev)=>{ //alias addListener
console.log("off",ev)
})
em.on("chat",(ev)=>{
console.log("w",ev)
})
em.on("*",(ev)=>{
console.log("w2h",ev)
})
//emitter
em.emit("chat",new Map().set("h",()=>{console.log("bb")}))
```
## Contributing
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution guidelines.
## License
MIT