# @typicalbot/events

> Minimalistic event library for Discord.js

Latest version **0.1.1** (published 2021-11-27) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @typicalbot/events
pnpm add @typicalbot/events
yarn add @typicalbot/events
bun add @typicalbot/events
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2021-11-27 |
| First published | 2021-11-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 54.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | nsylke |

## Links

- npm: https://www.npmjs.com/package/@typicalbot/events
- Repository: https://github.com/typicalbot/events
- Homepage: https://github.com/typicalbot/events#readme
- Issues: https://github.com/typicalbot/events/issues
- npm.io page: https://npm.io/package/@typicalbot/events

## Dependencies (1)

- [discord.js](https://npm.io/package/discord.js.md) ^13.3.1

## Recent versions

- 0.1.1 (latest) — 2021-11-27
- 0.1.0 — 2021-11-27

## README

# TypicalBot Events

Minimalistic event library for [Discord.js](https://github.com/discordjs/discord.js).

## Handling Events

```ts
import { EventHandler } from '@typicalbot/events';

// Add events to a collection
const events = new Collection<keyof ClientEvents, EventHandler<any>[]>();

// Register events in client logic
events.forEach((value, key) => {
    if (key === 'ready') {
        client.once(key, (...args) => {
            for (const handler of value) {
                handler(client, ...args);
            }
        });
    } else {
        client.on(key, (...args) => {
            for (const handler of value) {
                handler(client, ...args);
            }
        });
    }
})
```

---
_Source: https://npm.io/package/@typicalbot/events · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
