Skip to content

docs: update API example to ESM - #611

Merged
gustavohenke merged 1 commit into
open-cli-tools:mainfrom
Bibin-VR:docs/esm-usage-example
Aug 18, 2026
Merged

docs: update API example to ESM#611
gustavohenke merged 1 commit into
open-cli-tools:mainfrom
Bibin-VR:docs/esm-usage-example

Conversation

@Bibin-VR

Copy link
Copy Markdown
Contributor

concurrently v10 is pure ESM (type: module, and exports maps only ./dist/lib/index.js), so the README example no longer runs as written:

const concurrently = require('concurrently'); // -> namespace object
concurrently([...]); // TypeError: not a function

Verified against the published concurrently@10.0.5 on Node 22.

Switch the example to a named ESM import and replace __dirname, which does not exist in an ES module, with import.meta.dirname (Node >=20.11; package engines already require >=22).

Closes #606

concurrently v10 is pure ESM (type: module, and exports maps only
./dist/lib/index.js), so the README example no longer runs as written:

  const concurrently = require('concurrently');   // -> namespace object
  concurrently([...]);                            // TypeError: not a function

Verified against the published concurrently@10.0.5 on Node 22.

Switch the example to a named ESM import and replace __dirname, which does
not exist in an ES module, with import.meta.dirname (Node >=20.11; package
engines already require >=22).

Closes open-cli-tools#606
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.757%. remained the same — Bibin-VR:docs/esm-usage-example into open-cli-tools:main

@gustavohenke gustavohenke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@gustavohenke
gustavohenke merged commit b2580cc into open-cli-tools:main Aug 18, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs for new API usage (ESM style)

3 participants