Skip to content
Commit Detail

Commit f82812e

Author
James M Snell <jsnell@cloudflare.com> 2025-03-04 08:50:31 -0800
Parents
2bfff7a
Tree
3a4f13d
Implement importable env (#3610)

```js
import { env } from 'cloudflare:workers';

console.log(env.FOO);

export default {
  fetch(req) {
    console.log(env.FOO);
    // ...
  }
}
```

Gated by a compat flag that is on by default

  * `allow_importable_env`
  * `disallow_importable_env`

Mutations of the env properties are passed through to the underlying
object so will be reflected on the `env` argument passed into the
handlers.

Files changed