Skip to content

Commit ffc7897

Browse files
authored
Deprecate import from commander/esm.mjs (#1887)
1 parent 2f07c2a commit ffc7897

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

docs/deprecated.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ They are currently still available for backwards compatibility, but should not b
99
- [Default import of global Command object](#default-import-of-global-command-object)
1010
- [Callback to .help() and .outputHelp()](#callback-to-help-and-outputhelp)
1111
- [.on('--help')](#on--help)
12-
- [.on('command:*')](#oncommand)
13-
- [.command('*')](#command)
12+
- [.on('command:\*')](#oncommand)
13+
- [.command('\*')](#command)
1414
- [cmd.description(cmdDescription, argDescriptions)](#cmddescriptioncmddescription-argdescriptions)
1515
- [InvalidOptionArgumentError](#invalidoptionargumenterror)
1616
- [Short option flag longer than a single character](#short-option-flag-longer-than-a-single-character)
17+
- [Import from `commander/esm.mjs`](#import-from-commanderesmmjs)
1718

1819
## RegExp .option() parameter
1920

@@ -190,3 +191,19 @@ Deprecated from Commander v8.
190191
Short option flags like `-ws` were never supported, but the old README did not make this clear. The README now states that short options are a single character.
191192

192193
README updated in Commander v3. Deprecated from Commander v9.
194+
195+
## Import from `commander/esm.mjs`
196+
197+
The first support for named imports required an explicit entry file.
198+
199+
```js
200+
import { Command } from 'commander/esm.mjs';
201+
```
202+
203+
This is no longer required, just import directly from the module.
204+
205+
```js
206+
import { Command } from 'commander';
207+
```
208+
209+
README updated in Commander v9. Deprecated from Commander v9.

0 commit comments

Comments
 (0)