// the find
discordjs/discord.js
A powerful JavaScript library for interacting with the Discord API
discord.js is the dominant Node.js library for building Discord bots, wrapping Discord's REST API, WebSocket gateway, and voice protocol into a TypeScript-first package. It's a monorepo of ~12 packages that can be used independently — you can use just `@discordjs/rest` without pulling in the whole thing. If you're building anything on Discord's API in JavaScript/TypeScript, this is what everyone uses.
The package decomposition is genuinely well thought out: `@discordjs/core` gives you a thin, low-abstraction layer if you don't want the opinionated cache model, while the main `discord.js` package gives you the full high-level experience. The TypeScript types are derived from Discord's official API types, so when Discord ships a new field the types actually reflect it. The `@discordjs/builders` package for constructing slash command payloads saves you from a lot of error-prone manual object construction. Active maintenance is not in question — pushed today, 26k stars, and the release pipeline is fully automated.
The gateway caching model is the main footgun: by default the library caches members, messages, and channels in memory, which will eat your RAM as your bot scales and there's no obvious LRU or size cap built in — you have to configure intents and cache sweepers manually or pay the price later. Sharding is handled but awkward; you're expected to spin up a `ShardingManager` process yourself, and cross-shard communication via `@discordjs/brokers` requires standing up Redis or a similar broker. Voice support via `@discordjs/voice` still requires optional native dependencies (`@discordjs/opus`, `sodium-native`) that routinely break on Windows or in Alpine containers. The v14 migration was painful enough that the guide still has a dedicated legacy section — Discord API changes force breaking major versions with some regularity, so long-term maintenance of a bot means recurring upgrade tax.