0.0.3 • Published 3 years ago
unipack-example v0.0.3
unipack-example
Do you want to author an npm module that uses fetch and should work in any JavaScript context? Then use this project as a template.
This is an example project bringing fetch to different JavaScript contexts: browser, Node.js, and Cloudflare Workers.
As long as your code goes through a bundler that knows how and when to use the browser field in package.json, you can use fetch. We've verified this approach works for:
Scripts
pnpm publish # will build and publish
pnpm build
pnpm test # will test in jsdom + lint + type check + prettier