Skip to content

Export a browser version #511

@benmccann

Description

@benmccann

We had a user who wanted to use this package on Cloudflare Workers. The Node APIs are not available there so you can't import node:fs. It'd be nice if the other APIs could be made available without that functionality and import

You could make it available in the browser by exporting a smaller subset of APIs that has most of the functionality except for writing to files:

"exports": {
  "browser": "./my-browser-version.js",
  "require": "./my-cjs-version.cjs",
  "default": "./my-esm-version.js",
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions