Skip to content

Add documentation around using ESM imports #1019

@hammzj

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')

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