Skip to content

Support for ESM #621

@Dev79844

Description

@Dev79844

Is your feature request related to a problem? Please describe.
The cloudevents package is currently published only as CommonJS. This makes it difficult to consume in native ESM environments (e.g., Node.js with "type": "module" or .mjs files) without additional interop code. Developers must resort to workarounds like createRequire() or transpilation, which adds friction and complexity to using the library.

Describe the solution you would like to see
Publish cloudevents as a dual package that supports both CommonJS and native ESM:

  • Retain the existing CommonJS build for backward compatibility.
  • Add an ESM build with package.json "exports" and "type" fields set appropriately.
  • Ensure the ESM build supports direct imports and works in Node.js, modern browsers, and serverless environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions