Minor Changes
-
#4523
9f96f28b
Thanks @dario-piotrowicz! - Add newgetBindingsProxy
utility to the wrangler packageThe new utility is part of wrangler's JS API (it is not part of the wrangler CLI) and its use is to provide proxy objects to bindings, such objects can be used in Node.js code as if they were actual bindings
The utility reads the
wrangler.toml
file present in the current working directory in order to discern what bindings should be available (awrangler.json
file can be used too, as well as config files with custom paths).Example
Assuming that in the current working directory there is a
wrangler.toml
file with the following
content:[[kv_namespaces]] binding = "MY_KV" id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
The utility could be used in a nodejs script in the following way:
import { getBindingsProxy } from "wrangler"; const { bindings, dispose } = await getBindingsProxy(); try { const myKv = bindings.MY_KV; const kvValue = await myKv.get("my-kv-key"); console.log(`KV Value = ${kvValue}`); } finally { await dispose(); }
Patch Changes
-
#3427
b79e93a3
Thanks @ZakKemble! - fix: Use Windows SYSTEMROOT env var for finding netstatCurrently, the drive letter of os.homedir() (the user's home directory) is used to build the path to netstat.exe. However, user directories are not always on the same drive as the Windows installation, in which case the path to netstat will be incorrect. Now we use the %SYSTEMROOT% environment variable which correctly points to the installation path of Windows.
-
#4768
c3e410c2
Thanks @petebacondarwin! - ci: bump undici versions to 5.28.2 -
Updated dependencies [
c3e410c2
]:- miniflare@3.20231218.3