Skip to content

Provide an ES Module entrypoint for @elastic/elasticsearchΒ #1743

@adamyeats

Description

@adamyeats

Related to #1281 and #1742.

πŸš€ Feature Proposal

@elastic/elasticsearch is currently a CommonJS module. While CommonJS isn't going away any time soon, ECMAScript Modules are very much "the future" of the JavaScript ecosystem. As the community moves in this direction, it may be wise for us to consider moving this library in the same way.

To accommodate both CJS and ESM users, we might want to create an ES module wrapper that exports both a CJS and ESM version of the library.

At the very least, as suggested in #1281, it would be good to make the type of the module explicit in package.json if we decide to remain with CJS for the time being.

Motivation

This will allow the library to work in Deno, and enable asynchronous module loading in Deno and Node.js.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions