Visitar URL original
Add documentation around using ESM imports · Issue #1019 · debug-js/debug · GitHub
Skip to content

Add documentation around using ESM imports #1019

Description

@hammzj

I ran into an issue with named imports that was similar to #1001, and then I noticed that the README does not include any information on how to import this package using ESM.

Could the README be updated since there are more projects using modules with import/export syntax over commonjs?

Edit: it possibly just needs a reference to use this syntax:

//import comes from the default export
import debug from 'debug';
export default debug('your-package-name')


//With an alias
import {default as debugInitializer} from 'debug';
export default const debug('your-package-name')

Activity

  1. added a commit that references this issue on Jan 29, 2026
    2c33388
  2. reopened this on Mar 20, 2026
  3. kvnloo commented on Sep 4, 2026

    @kvnloo

    PR #1022 still looks like the right non-duplicative path for this issue. I checked its patch against current master (f405ade8a4b7a0dc353e0f7390c1be90060f3621): it is mergeable, changes only README.md (31 additions), and is two commits behind. I also verified import debug from 'debug' against debug@4.4.3 in native Node ESM and TypeScript nodenext; both resolve to a callable factory. If maintainers are open to landing this documentation, the existing PR should only need a refresh rather than a second implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions