Packages

wrangler

4.164.0 · 17 Nov 2026MIT OR Apache-2.049.3M / weekRepositoryHomepagenpmAtom feed

Your version

2.9.0

30 Jan 2023Where it was published

2.21.3 is the newest release of 2.x.

npm marks 2.9.0 as deprecated: Wrangler v2 is no longer supported. Please upgrade to Wrangler v4

In short

1 new7 fixed

Security

3 advisories affect 2.9.0; 3.114.17 fixes them

Release note

Minor Changes

  • Prefer the workerd exports condition when bundling.

    This can be used to build isomorphic libraries that have different implementations depending on the JavaScript runtime they're running in.
    When bundling, Wrangler will try to load the workerd key.
    This is the standard key for the Cloudflare Workers runtime.
    Learn more about the conditional exports field here.

Patch Changes

  • Wrangler now supports an --experimental-json-config flag which will read your configuration from a wrangler.json file, rather than wrangler.toml. The format of this file is exactly the same as the wrangler.toml configuration file, except that the syntax is JSONC (JSON with comments) rather than TOML. This is experimental, and is not recommended for production use.

  • Fix d1 directory not being created when running the wrangler d1 execute command with the --yes/-y flag

  • Add support for D1 databases when bundling an _worker.js on wrangler pages publish

  • Do not crash in wrangler dev when passing a request object to fetch

    This reverts and fixes the changes in #1769
    which does not support creating requests from requests whose bodies have already been consumed.

    Fixes #2562

  • Implement d1 list --json with clean output for piping into other commands

    Before:

    rozenmd@cflaptop test % npx wrangler d1 list
    --------------------
    🚧 D1 is currently in open alpha and is not recommended for production data and traffic
    🚧 Please report any bugs to https://github.com/cloudflare/wrangler2/issues/new/choose
    🚧 To request features, visit https://community.cloudflare.com/c/developers/d1
    🚧 To give feedback, visit https://discord.gg/cloudflaredev
    --------------------
    
    ┌──────────────────────────────┬─────────────────┐
    │ uuid                         │ name            │
    ├──────────────────────────────┼─────────────────┤
    │ xxxxxx-xxxx-xxxx-xxxx-xxxxxx │ test            │
    ├──────────────────────────────┼─────────────────┤
    │ xxxxxx-xxxx-xxxx-xxxx-xxxxxx │ test2           │
    ├──────────────────────────────┼─────────────────┤
    │ xxxxxx-xxxx-xxxx-xxxx-xxxxxx │ test3           │
    └──────────────────────────────┴─────────────────┘

    After:

    rozenmd@cflaptop test % npx wrangler d1 list --json
    [
      {
        "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
        "name": "test"
      },
      {
        "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
        "name": "test2"
      },
      {
        "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
        "name": "test3"
      },
    ]
  • Fix wrangler publish --dry-run to not require authentication when using Queues

  • Implement d1 execute --json with clean output for piping into other commands

    Before:

    rozenmd@cflaptop test1 % npx wrangler d1 execute test --command="select * from customers"
    ▲ [WARNING] Processing wrangler.toml configuration:
    
        - D1 Bindings are currently in alpha to allow the API to evolve before general availability.
          Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose
          Note: Run this command with the environment variable NO_D1_WARNING=true to hide this message
    
          For example: `export NO_D1_WARNING=true && wrangler <YOUR COMMAND HERE>`
    
    --------------------
    
      🚧 D1 is currently in open alpha and is not recommended for production data and traffic
      🚧 Please report any bugs to <https://github.com/cloudflare/wrangler2/issues/new/choose>
      🚧 To request features, visit <https://community.cloudflare.com/c/developers/d1>
      🚧 To give feedback, visit <https://discord.gg/cloudflaredev>
    
    --------------------
    
      🌀 Mapping SQL input into an array of statements
      🌀 Parsing 1 statements
      🌀 Executing on test (xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx):
      🚣 Executed 1 command in 11.846710999961942ms
      ┌────────────┬─────────────────────┬───────────────────┐
      │ CustomerID │ CompanyName         │ ContactName       │
      ├────────────┼─────────────────────┼───────────────────┤
      │ 1          │ Alfreds Futterkiste │ Maria Anders      │
      ├────────────┼─────────────────────┼───────────────────┤
      │ 4          │ Around the Horn     │ Thomas Hardy      │
      ├────────────┼─────────────────────┼───────────────────┤
      │ 11         │ Bs Beverages        │ Victoria Ashworth │
      ├────────────┼─────────────────────┼───────────────────┤
      │ 13         │ Bs Beverages        │ Random Name       │
      └────────────┴─────────────────────┴───────────────────┘
    
    

    After:

    rozenmd@cflaptop test1 % npx wrangler d1 execute test --command="select * from customers" --json
    [
      {
        "results": [
          {
            "CustomerID": 1,
            "CompanyName": "Alfreds Futterkiste",
            "ContactName": "Maria Anders"
          },
          {
            "CustomerID": 4,
            "CompanyName": "Around the Horn",
            "ContactName": "Thomas Hardy"
          },
          {
            "CustomerID": 11,
            "CompanyName": "Bs Beverages",
            "ContactName": "Victoria Ashworth"
          },
          {
            "CustomerID": 13,
            "CompanyName": "Bs Beverages",
            "ContactName": "Random Name"
          }
        ],
        "success": true,
        "meta": {
          "duration": 1.662519000004977,
          "last_row_id": null,
          "changes": null,
          "served_by": "primary-xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.db3",
          "internal_stats": null
        }
      }
    ]

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.