Skip to content

Update all dependencies to latest and support ESM #69

Closed

Description

@leerob

It'd be great to support both ESM and CJS here.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Activity

  1. bryan-hoang commented on Feb 14, 2022

    @bryan-hoang
    Contributor

    support both ESM and CJS

    I'd like to clarify my interpretation of the intent of the issue. The way I understand it, we'd like to convert the (currently) CommonJS title package into a pure ESM project. That would imply a breaking change for CommonJS consumers of the title package that would force them to pursue one of the 3 options presented at the beginning of the linked gist.

    i.e., the "support" for CJS would come from the following point made in the gist:

    1. If the package [e.g., title] is used in an async context, you could use await import(…) from CommonJS instead of require(…).

    Would that interpretation be correct?

  2. leerob commented on Feb 16, 2022

    @leerob
    ContributorAuthor

    So that document shows how to make a pure ESM package. There are pros to that. If possible, it would be great to support both CJS and ESM for best backwards compat. I'm not an expert here, but ms recently made this change.

    vercel/ms#163

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