Workers : Access to NPM?

Do we have access to npm (or the node runtime) via workers?

This post says you do not.
This deprecated document says you can use npm modules.
Now with wrangler we have access to webpack so presumably could use npm.

The reason I am asking is I would like to develop a full app based on cloudflare workers. Naturally, having access to npm could facilitate that objective.

You can use them if you webpack them and they don’t use any Node APIs. For example, your worker can use vue, react, etc. But not things like smart-fs or mkdirp.

I believe those questions were asking about the worker runtime itself being able to load from require().

2 Likes