Cloudflare workers support all Node.js packages that are bundled with webpack or any other polyfill bundler (https://blog.cloudflare.com/node-js-support-cloudflare-workers/)
- Installing a package is as normal as using the common npm syntax (
npm install <dep>
) - If the dependency depends on Node.js native builtins, the
node_compat = true
config needs to be included inwrangler.toml
- Importing a package is done using the ESM syntax (
import {...} from '<dep>'
)