---
title: Bun v1.0.2
description: "Faster watch mode, bunx @latest bugfix, Bun uses V8's date parser, bugfixes to node:readline, node:dns, bun run, http streaming, transpiler, node:tty and more"
date: "2023-09-15T16:51:51.997Z"
author: jarred
draft: false
---

Bun v1.0.2 fixes numerous bugs and makes `bun --watch` faster.

Thank you for reporting issues. We are working hard to fix them as quickly as possible.

Bun is an incredibly fast JavaScript runtime, bundler, transpiler, and package manager &mdash; all in one. We've been releasing a lot of changes to Bun recently. Here's a recap of the last few releases. In case you missed it:

- [`v1.0.0`](/blog/bun-v1.0) - Bun's first stable release!
- [`v1.0.1`](/blog/bun-v1.0.1) - Named imports for .json & .toml files, bugfixes to bun install, node:path, Buffer

To install Bun:

{% codetabs %}

```sh#curl
$ curl -fsSL https://bun.sh/install | bash
```

```sh#npm
$ npm install -g bun
```

```sh#brew
$ brew tap oven-sh/bun
$ brew install bun
```

```sh#docker
$ docker pull oven/bun
$ docker run --rm --init --ulimit memlock=-1:-1 oven/bun
```

{% /codetabs %}

To upgrade Bun:

```sh
$ bun upgrade
```

### `bunx <package>@latest` always fetches the latest

Previously, `bunx package@latest` would only fetch the latest version of the package if it had not been installed previously in the `/tmp` folder (which is cleared every 3 days or on restart, dpending on your OS).

Now, `bunx package@latest` will always fetch the latest version of the package. If there is an `@` tag and that tag is not a number, it will fetch the query the npm registry for the matching version of the package.

[#5346](https://github.com/oven-sh/bun/pull/5346)

### Faster `bun --watch`

`bun --watch <./path-to-file.ts>` lets you watch a file and re-run it when it or any of its imports change. This is useful for development.

Previously, `bun --watch` would enqueue a task to the event loop on change to reload the process. That means any blocking or long-running tasks would delay the reload.

Now, it reloads immediately.

{% raw %}

<img src="https://user-images.githubusercontent.com/709451/267581397-badc01dd-f08b-4752-9b5a-b69a76c25d72.gif" />

{% /raw %}

In this gif, the current timestamp in milliseconds is printed to the console on restart.

### `bun run --silent` no longer prints error messages

When running:

```bash
$ bun run --silent bash -c 'exit 1'
```

Before:

```bash
$ error: "bash" exited with code 1
```

After:

```bash
$ # nothing!
```

### Bun now uses V8's `Date` parser

Bun now uses V8's Date parser. This means that date parsing behaves the same in Bun as it does in Chrome and Node.js.

Previously:

```ts
Date.parse("2020-09-21 15:19:06 +00:00"); // Invalid Date
```

After:

```ts
Date.parse("2020-09-21 15:19:06 +00:00"); // 1600701546000
```

This fixes a number of bugs where date parsing would fail in Bun but work in Node.js.

### `URL.canParse` is implemented

The `URL` class now has a static `canParse` method, which returns `true` if the URL can be parsed, and `false` otherwise.

```ts
URL.canParse("https://example.com"); // true
URL.canParse("https://example.com:8080"); // true
URL.canParse("apoksd!"); // false
```

[`URL.canParse`](https://developer.mozilla.org/en-US/docs/Web/API/URL/canParse_static) is a relatively new addition to the Web Platform. At the time of writing, it is not available in Chrome or Firefox yet.

### `URLSearchParams.prototype.size` is implemented

The `URLSearchParams` class now has a `size` property, which returns the number of key/value pairs in the search params.

```ts
const params = new URLSearchParams("a=1&b=2&c=3");
params.size; // 3
```

[`URLSearchParams.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/size) is a relatively new addition to the Web Platform.

### Bugfix to `bun run`

Previously, `bun run` would always load tsconfig.json files. This meant that having an invalid tsconfig.json file could cause `bun run` to fail, which was completely unnecessary. THis has been fixed.

### Bugfix to `node:stream`

When `encoding` was passed to the `write` function, the `callback` would not be called. This has been fixed.

[#75b5c715405d49b5026c13143efecd580d27be1b](https://github.com/oven-sh/bun/commit/75b5c715405d49b5026c13143efecd580d27be1b)

### Bugfix to fetch with a `data:` URL

Previously, invalid `data:` URLs would throw an exception in `fetch`. This was inconsistent with Node.js which would leave the incorrect data in the URL. This has been fixed, thanks to [@davidmhewitt](https://github.com/davidmhewitt).

[#c3455c0ceee6bbe399781819a42fff6cf24792e2](https://github.com/oven-sh/bun/commit/c3455c0ceee6bbe399781819a42fff6cf24792e2)

### Bugfix to `node:readline` (arrow keys)

A bug in `node:readline` causing the terminal to hang on WSL has been fixed.

[#5345](https://github.com/oven-sh/bun/issues/5435)

### Bugfix to `node:dns`

A crash in `node:dns`'s `resolve` function has been fixed, thanks to [@Hanaasagi](https://github.com/Hanaasagi).

[#5200](https://github.com/oven-sh/bun/pull/5200)

### `os.availableParallelism` is implemented

The `node:os` module now has an [`availableParallelism`](https://nodejs.org/api/os.html#os_os_availableparallelism) property, which returns the number of logical CPUs available to the process.

```ts
os.availableParallelism(); // 8
```

You can also use `navigator.hardwareConcurrency`.

### Bugfixes to `Bun.serve()`

A crash that could occur when a ReadableStream has enqueued all data before the stream has begun being read has been fixed. This crash happened because the code was missing a check for whether or not a JavaScript function was a callable object.

[#5321](https://github.com/oven-sh/bun/issues/5321)

A crash that could occur when calling `req.formData()` has been fixed

[#4966](https://github.com/oven-sh/bun/issues/4966)

### Fix `set-cookie`

A bug causing the `set-cookie` header to be set incorrectly in `node:http` in some cases has been fixed. This causes issues with Express.js.

[#5183](https://github.com/oven-sh/bun/issues/5183)

### `node:fs` functions are now concurrent

Previously, only a handful of `node:fs` functions were concurrent. Now, all of them are.

### Deletable `setTimeout` & other globals

Most globals are now configurable/deletable, which fixes issues impacting some libraries and ExecJS.

### Bugfix for fastify

Fastify loops over `require.cache` during initialization. `require.cache` previously included ES Modules which have not finished evaluating yet and that partially broke Fastify. This has been fixed.

### Bugfix for multiline string in CRLF terminated files

Thanks to [@tikotzky](https://github.com/tikotzky) for the fix.

[#5318](https://github.com/oven-sh/bun/pull/5318)

### Bugfix for `Bun.file()`

When the length of the file was less than the size of the `Bun.file()`, the file would sometimes not finish reading. This has been fixed, thanks to [@cirospaciari](https://github.com/cirospaciari).

[#5186](https://github.com/oven-sh/bun/pull/5186)

### Bugfix for `node:tty`

A bug causing `WritableStream.prototype.getColorDepth` to sometimes throw an exception has been fixed.

[#5468](https://github.com/oven-sh/bun/pull/5468)

### Transpiler bugfix for escaping non-ascii `RegExp` literals to latin1

[#5468](https://github.com/oven-sh/bun/pull/5468)

### Internal changes

We upgraded from LLVM 15->16 & Clang 15->16.

## Full changelog

{% table %}

---

- [`#5161`](https://github.com/oven-sh/bun/pull/5161)
- fix(bun-lambda) Fix API Gateway V1 events and expand on Lambda documentation by [@mkossoris](https://github.com/mkossoris)

---

- [`#5159`](https://github.com/oven-sh/bun/pull/5159)
- fix lifecycle docu by [@ximex](https://github.com/ximex)

---

- [`#5151`](https://github.com/oven-sh/bun/pull/5151)
- docs: fix typos by [@s-rigaud](https://github.com/s-rigaud)

---

- [`#5127`](https://github.com/oven-sh/bun/pull/5127)
- Updated Lambda readme by [@tsndr](https://github.com/tsndr)

---

- [`#5072`](https://github.com/oven-sh/bun/pull/5072)
- Add missing full stop on nodejs-apis.md by [@diogo405](https://github.com/diogo405)

---

- [`#5069`](https://github.com/oven-sh/bun/pull/5069)
- update dev build instruction for arch by [@mi4uu](https://github.com/mi4uu)

---

- [`#5046`](https://github.com/oven-sh/bun/pull/5046)
- fix typo and grammar errors in bunfig.toml by [@xNaCly](https://github.com/xNaCly)

---

- [`#4997`](https://github.com/oven-sh/bun/pull/4997)
- Update simple.md by [@tomredman](https://github.com/tomredman)

---

- [`#4990`](https://github.com/oven-sh/bun/pull/4990)
- Update hot.md by [@nazeelashraf](https://github.com/nazeelashraf)

---

- [`#5146`](https://github.com/oven-sh/bun/pull/5146)
- docs: fix typo in import.meta.resolve by [@jonathantneal](https://github.com/jonathantneal)

---

- [`#5143`](https://github.com/oven-sh/bun/pull/5143)
- [Docs] Use git's `--global` flag for lockfile diffs instead of manually editing config files. by [@Southpaw1496](https://github.com/Southpaw1496)

---

- [`#5201`](https://github.com/oven-sh/bun/pull/5201)
- Various docs by [@colinhacks](https://github.com/colinhacks)

---

- [`#5120`](https://github.com/oven-sh/bun/pull/5120)
- docs: Made bun-types install as dev dependency in example by [@MasterGordon](https://github.com/MasterGordon)

---

- [`#4841`](https://github.com/oven-sh/bun/pull/4841)
- js/node/stream.js: call write() callback when encoding is not provided by [@cfal](https://github.com/cfal)

---

- [`#5234`](https://github.com/oven-sh/bun/pull/5234)
- Correct the configuration file names. by [@nathanhammond](https://github.com/nathanhammond)

---

- [`#5167`](https://github.com/oven-sh/bun/pull/5167)
- decode regex if needed by [@dylan-conway](https://github.com/dylan-conway)

---

- [`#5227`](https://github.com/oven-sh/bun/pull/5227)
- Update misleading documentation link by [@0x346e3730](https://github.com/0x346e3730)

---

- [`#5061`](https://github.com/oven-sh/bun/pull/5061)
- file.exists() needs to be awaited to get the value by [@amt8u](https://github.com/amt8u)

---

- [`#5243`](https://github.com/oven-sh/bun/pull/5243)
- docs(runtime): fix jsx FragmentFactory output example by [@zongzi531](https://github.com/zongzi531)

---

- [`#5248`](https://github.com/oven-sh/bun/pull/5248)
- Add informative message on `bun create react` by [@colinhacks](https://github.com/colinhacks)

---

- [`#5140`](https://github.com/oven-sh/bun/pull/5140)
- chore: make comment grammatically correct by [@G-Rath](https://github.com/G-Rath)

---

- [`#5250`](https://github.com/oven-sh/bun/pull/5250)
- docs(runtime): fix plugins loader extensions typo by [@zongzi531](https://github.com/zongzi531)

---

- [`#5057`](https://github.com/oven-sh/bun/pull/5057)
- avoid inserting extraneous"accept-encoding" header by [@iidebyo](https://github.com/iidebyo)

---

- [`#5126`](https://github.com/oven-sh/bun/pull/5126)
- fix(node/fetch): Make data URL fetch consistent with node by [@davidmhewitt](https://github.com/davidmhewitt)

---

- [`#5275`](https://github.com/oven-sh/bun/pull/5275)
- docs: update lockfile diff instructions by [@gtramontina](https://github.com/gtramontina)

---

- [`#5311`](https://github.com/oven-sh/bun/pull/5311)
- add uninstall instructions by [@browner12](https://github.com/browner12)

---

- [`#5294`](https://github.com/oven-sh/bun/pull/5294)
- docs(guide): fix expect assertion example in guide for `spyOn` by [@winghouchan](https://github.com/winghouchan)

---

- [`#5281`](https://github.com/oven-sh/bun/pull/5281)
- chore(docs): include missing links to Node.js APIs by [@styfle](https://github.com/styfle)

---

- [`#5262`](https://github.com/oven-sh/bun/pull/5262)
- Fixed api & cli docs typo. by [@jamesgordo](https://github.com/jamesgordo)

---

- [`#5233`](https://github.com/oven-sh/bun/pull/5233)
- fix(runtime): require cache should not include unevaluated ESM modules. by [@paperclover](https://github.com/paperclover)

---

- [`#5236`](https://github.com/oven-sh/bun/pull/5236)
- Make --watch instant by [@Jarred-Sumner](https://github.com/Jarred-Sumner)

---

- [`#5109`](https://github.com/oven-sh/bun/pull/5109)
- feat(nodejs): implement `os.availableParallelism` by [@WingLim](https://github.com/WingLim)

---

- [`#5164`](https://github.com/oven-sh/bun/pull/5164)
- fix(console.log) fix printing long custom format by [@cirospaciari](https://github.com/cirospaciari)

---

- [`#5200`](https://github.com/oven-sh/bun/pull/5200)
- fix(node:dns): fix crash and compatibility issues with `resolve` by [@Hanaasagi](https://github.com/Hanaasagi)

---

- [`#5325`](https://github.com/oven-sh/bun/pull/5325)
- fix(doc): Add "compilerOptions" to bun-types README.md by [@philolo1](https://github.com/philolo1)

---

- [`#5186`](https://github.com/oven-sh/bun/pull/5186)
- fix(BunFile.slice) fix slice when length is greater than the size by [@cirospaciari](https://github.com/cirospaciari)

---

- [`#5229`](https://github.com/oven-sh/bun/pull/5229)
- More docs & helptext cleanup by [@colinhacks](https://github.com/colinhacks)

---

- [`#5285`](https://github.com/oven-sh/bun/pull/5285)
- doc(guides): update sveltekit guide by [@mroyme](https://github.com/mroyme)

---

- [`#5225`](https://github.com/oven-sh/bun/pull/5225)
- modules documentation didn't have correct import example by [@miccou](https://github.com/miccou)

---

- [`#5115`](https://github.com/oven-sh/bun/pull/5115)
- fix link to "local template" by [@desm](https://github.com/desm)

---

- [`#5244`](https://github.com/oven-sh/bun/pull/5244)
- chore: test for overwriting \_resolveFilename by [@paperclover](https://github.com/paperclover)

---

- [`#5318`](https://github.com/oven-sh/bun/pull/5318)
- Fix bug with multiline string in CRLF terminated files (#4893) by [@tikotzky](https://github.com/tikotzky)

---

- [`#5216`](https://github.com/oven-sh/bun/pull/5216)
- fix(runtime): make most globals configurable/deletable, allow resuming the console iterator by [@paperclover](https://github.com/paperclover)

---

- [`#5152`](https://github.com/oven-sh/bun/pull/5152)
- fix(Bun.serve) fix buffering edge case by [@cirospaciari](https://github.com/cirospaciari)

---

- [`#4905`](https://github.com/oven-sh/bun/pull/4905)
- Update nextjs.md by [@kryparnold](https://github.com/kryparnold)

---

- [`#4881`](https://github.com/oven-sh/bun/pull/4881)
- Update simple.md by [@TwanLuttik](https://github.com/TwanLuttik)

---

- [`#4452`](https://github.com/oven-sh/bun/pull/4452)
- Update nuxt.md by [@s0h311](https://github.com/s0h311)

---

- [`#5335`](https://github.com/oven-sh/bun/pull/5335)
- Remove the ability to configure lockfile location. by [@nathanhammond](https://github.com/nathanhammond)

---

- [`#5346`](https://github.com/oven-sh/bun/pull/5346)
- In `bunx`, always get latest version when @latest is explicitly passed by [@Jarred-Sumner](https://github.com/Jarred-Sumner)

---

- [`#5376`](https://github.com/oven-sh/bun/pull/5376)
- Fix typo in HTTPThread name by [@chrisbodhi](https://github.com/chrisbodhi)

---

- [`#5379`](https://github.com/oven-sh/bun/pull/5379)
- docs - Add "workspace:\*" to workspace docs. by [@dylang](https://github.com/dylang)

---

- [`#4647`](https://github.com/oven-sh/bun/pull/4647)
- fix(docs): Fix the text that `bun run --bun` is the same as `bun` by [@DuGlaser](https://github.com/DuGlaser)

---

- [`#5419`](https://github.com/oven-sh/bun/pull/5419)
- fix warnings during bun run publish-layer by [@nangchan](https://github.com/nangchan)

---

- [`#5336`](https://github.com/oven-sh/bun/pull/5336)
- fix(runtime): emit `node:net` connect error event vs throw by [@paperclover](https://github.com/paperclover)

---

- [`#5332`](https://github.com/oven-sh/bun/pull/5332)
- v8 date parser tests by [@dylan-conway](https://github.com/dylan-conway)

---

- [`#5360`](https://github.com/oven-sh/bun/pull/5360)
- async-ify all node:fs functions by [@Jarred-Sumner](https://github.com/Jarred-Sumner)

---

- [`#5439`](https://github.com/oven-sh/bun/pull/5439)
- fix dockerfile by [@Jarred-Sumner](https://github.com/Jarred-Sumner)

---

- [`#5428`](https://github.com/oven-sh/bun/pull/5428)
- fix http set cookie headers by [@dylan-conway](https://github.com/dylan-conway)

---

- [`#5422`](https://github.com/oven-sh/bun/pull/5422)
- fix(nitro) fix sourcemaps and JSSink closing by [@cirospaciari](https://github.com/cirospaciari)

---

- [`#5425`](https://github.com/oven-sh/bun/pull/5425)
- Update docs/quickstart.md by [@sonyarianto](https://github.com/sonyarianto)

---

- [`#5341`](https://github.com/oven-sh/bun/pull/5341)
- dup and close file descriptors by [@dylan-conway](https://github.com/dylan-conway)

---

- [`#5459`](https://github.com/oven-sh/bun/pull/5459)
- Make `bun run --silent` omit `"error: "..." exited with code 1` by [@Jarred-Sumner](https://github.com/Jarred-Sumner)

---

- [`#5452`](https://github.com/oven-sh/bun/pull/5452)
- Does not fix #4622 by [@Jarred-Sumner](https://github.com/Jarred-Sumner)

---

- [`#5464`](https://github.com/oven-sh/bun/pull/5464)
- fix(proxy): allow empty string `http_proxy` env by [@Hanaasagi](https://github.com/Hanaasagi)

---

- [`#5463`](https://github.com/oven-sh/bun/pull/5463)
- Implement `URL.canParse` by [@Jarred-Sumner](https://github.com/Jarred-Sumner)

---

- [`#5467`](https://github.com/oven-sh/bun/pull/5467)
- Fixes #5461 by [@Jarred-Sumner](https://github.com/Jarred-Sumner)

---

- [`#5468`](https://github.com/oven-sh/bun/pull/5468)
- Fixes #5465 by [@Jarred-Sumner](https://github.com/Jarred-Sumner)

{% /table %}

## New contributors

Thanks to Bun's newest contributors!

[`@mkossoris`](https://github.com/@mkossoris) [`@ximex`](https://github.com/@ximex) [`@s-rigaud`](https://github.com/@s-rigaud) [`@tsndr`](https://github.com/@tsndr) [`@mi4uu`](https://github.com/@mi4uu) [`@xNaCly`](https://github.com/@xNaCly) [`@tomredman`](https://github.com/@tomredman) [`@nazeelashraf`](https://github.com/@nazeelashraf) [`@jonathantneal`](https://github.com/@jonathantneal) [`@Southpaw1496`](https://github.com/@Southpaw1496) [`@MasterGordon`](https://github.com/@MasterGordon) [`@cfal`](https://github.com/@cfal) [`@nathanhammond`](https://github.com/@nathanhammond) [`@0x346e3730`](https://github.com/@0x346e3730) [`@amt8u`](https://github.com/@amt8u) [`@zongzi531`](https://github.com/@zongzi531) [`@G-Rath`](https://github.com/@G-Rath) [`@iidebyo`](https://github.com/@iidebyo) [`@gtramontina`](https://github.com/@gtramontina) [`@browner12`](https://github.com/@browner12) [`@winghouchan`](https://github.com/@winghouchan) [`@philolo1`](https://github.com/@philolo1) [`@mroyme`](https://github.com/@mroyme) [`@miccou`](https://github.com/@miccou) [`@desm`](https://github.com/@desm) [`@tikotzky`](https://github.com/@tikotzky) [`@kryparnold`](https://github.com/@kryparnold) [`@TwanLuttik`](https://github.com/@TwanLuttik) [`@s0h311`](https://github.com/@s0h311) [`@chrisbodhi`](https://github.com/@chrisbodhi) [`@dylang`](https://github.com/@dylang) [`@DuGlaser`](https://github.com/@DuGlaser) [`@nangchan`](https://github.com/@nangchan) [`@sonyarianto`](https://github.com/@sonyarianto)
