Skip to content

chore(readme): clarify the use of ES modules in readme examples #10934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/api-extractor-model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ API documentation for this package: https://rushstack.io/pages/api/api-extractor
## Example Usage

The following code sample shows how to load `example.api.json`, which would be generated by API Extractor
when it analyzes a hypothetical NPM package called `example`:
when it analyzes a hypothetical NPM package called `example`. The example uses [ES modules](https://nodejs.org/api/esm.html#enabling).

```ts
import { ApiModel, ApiPackage } from '@discordjs/api-extractor-model';
Expand Down
2 changes: 2 additions & 0 deletions packages/brokers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ pnpm add @discordjs/brokers

## Example usage

These examples use [ES modules](https://nodejs.org/api/esm.html#enabling).

### pub sub

```ts
Expand Down
2 changes: 2 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ pnpm add @discordjs/core

## Example usage

These examples use [ES modules](https://nodejs.org/api/esm.html#enabling).

```ts
import { REST } from '@discordjs/rest';
import { WebSocketManager } from '@discordjs/ws';
Expand Down
2 changes: 2 additions & 0 deletions packages/discord.js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ pnpm add discord.js
bun add discord.js
```

These examples use [ES modules](https://nodejs.org/api/esm.html#enabling).

Register a slash command against the Discord API:

```js
Expand Down
2 changes: 2 additions & 0 deletions packages/formatters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ bun add @discordjs/formatters

## Example usage

The example uses [ES modules](https://nodejs.org/api/esm.html#enabling).

````ts
import { codeBlock } from '@discordjs/formatters';

Expand Down
2 changes: 2 additions & 0 deletions packages/ws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ bun add @discordjs/ws

## Example usage

The example uses [ES modules](https://nodejs.org/api/esm.html#enabling).

```ts
import { WebSocketManager, WebSocketShardEvents, CompressionMethod } from '@discordjs/ws';
import { REST } from '@discordjs/rest';
Expand Down