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.
v1.0.0- Bun's first stable release!
v1.0.1- Named imports for .json & .toml files, bugfixes to bun install, node:path, Buffer
To install Bun:
curl -fsSL https://bun.sh/install | bash
npm install -g bun
brew tap oven-sh/bun
brew install bun
docker pull oven/bun
docker run --rm --init --ulimit memlock=-1:-1 oven/bun
To upgrade Bun:
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).
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.
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.
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.
In this gif, the current timestamp in milliseconds is printed to the console on restart.
bun run --silent bash -c 'exit 1'
error: "bash" exited with code 1
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.
Date.parse("2020-09-21 15:19:06 +00:00"); // Invalid Date
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 class now has a static
canParse method, which returns
true if the URL can be parsed, and
URL.canParse("https://example.com"); // true URL.canParse("https://example.com:8080"); // true URL.canParse("apoksd!"); // false
URL.canParse is a relatively new addition to the Web Platform. At the time of writing, it is not available in Chrome or Firefox yet.
URLSearchParams class now has a
size property, which returns the number of key/value pairs in the search params.
const params = new URLSearchParams("a=1&b=2&c=3"); params.size; // 3
URLSearchParams.prototype.size is a relatively new addition to the Web Platform.
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.
encoding was passed to the
write function, the
callback would not be called. This has been fixed.
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.
A bug in
node:readline causing the terminal to hang on WSL has been fixed.
A crash in
resolve function has been fixed, thanks to @Hanaasagi.
node:os module now has an
availableParallelism property, which returns the number of logical CPUs available to the process.
os.availableParallelism(); // 8
You can also use
A crash that could occur when calling
req.formData() has been fixed
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.
Previously, only a handful of
node:fs functions were concurrent. Now, all of them are.
Most globals are now configurable/deletable, which fixes issues impacting some libraries and ExecJS.
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.
Thanks to @tikotzky for the fix.
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.
A bug causing
WritableStream.prototype.getColorDepth to sometimes throw an exception has been fixed.
We upgraded from LLVM 15->16 & Clang 15->16.
|fix(bun-lambda) Fix API Gateway V1 events and expand on Lambda documentation by @mkossoris|
|fix lifecycle docu by @ximex|
|docs: fix typos by @s-rigaud|
|Updated Lambda readme by @tsndr|
|Add missing full stop on nodejs-apis.md by @diogo405|
|update dev build instruction for arch by @mi4uu|
|fix typo and grammar errors in bunfig.toml by @xNaCly|
|Update simple.md by @tomredman|
|Update hot.md by @nazeelashraf|
|docs: fix typo in import.meta.resolve by @jonathantneal|
|[Docs] Use git's |
|Various docs by @colinhacks|
|docs: Made bun-types install as dev dependency in example by @MasterGordon|
|js/node/stream.js: call write() callback when encoding is not provided by @cfal|
|Correct the configuration file names. by @nathanhammond|
|decode regex if needed by @dylan-conway|
|Update misleading documentation link by @0x346e3730|
|file.exists() needs to be awaited to get the value by @amt8u|
|docs(runtime): fix jsx FragmentFactory output example by @zongzi531|
|Add informative message on |
|chore: make comment grammatically correct by @G-Rath|
|docs(runtime): fix plugins loader extensions typo by @zongzi531|
|avoid inserting extraneous"accept-encoding" header by @iidebyo|
|fix(node/fetch): Make data URL fetch consistent with node by @davidmhewitt|
|docs: update lockfile diff instructions by @gtramontina|
|add uninstall instructions by @browner12|
|docs(guide): fix expect assertion example in guide for |
|chore(docs): include missing links to Node.js APIs by @styfle|
|Fixed api & cli docs typo. by @jamesgordo|
|fix(runtime): require cache should not include unevaluated ESM modules. by @paperdave|
|Make --watch instant by @Jarred-Sumner|
|feat(nodejs): implement |
|fix(console.log) fix printing long custom format by @cirospaciari|
|fix(node:dns): fix crash and compatibility issues with |
|fix(doc): Add "compilerOptions" to bun-types README.md by @philolo1|
|fix(BunFile.slice) fix slice when length is greater than the size by @cirospaciari|
|More docs & helptext cleanup by @colinhacks|
|doc(guides): update sveltekit guide by @mroyme|
|modules documentation didn't have correct import example by @miccou|
|fix link to "local template" by @desm|
|chore: test for overwriting _resolveFilename by @paperdave|
|Fix bug with multiline string in CRLF terminated files (#4893) by @tikotzky|
|fix(runtime): make most globals configurable/deletable, allow resuming the console iterator by @paperdave|
|fix(Bun.serve) fix buffering edge case by @cirospaciari|
|Update nextjs.md by @kryparnold|
|Update simple.md by @TwanLuttik|
|Update nuxt.md by @s0h311|
|Remove the ability to configure lockfile location. by @nathanhammond|
|Fix typo in HTTPThread name by @chrisbodhi|
|docs - Add "workspace:*" to workspace docs. by @dylang|
|fix(docs): Fix the text that |
|fix warnings during bun run publish-layer by @nangchan|
|fix(runtime): emit |
|v8 date parser tests by @dylan-conway|
|async-ify all node:fs functions by @Jarred-Sumner|
|fix dockerfile by @Jarred-Sumner|
|fix http set cookie headers by @dylan-conway|
|fix(nitro) fix sourcemaps and JSSink closing by @cirospaciari|
|Update docs/quickstart.md by @sonyarianto|
|dup and close file descriptors by @dylan-conway|
|Does not fix #4622 by @Jarred-Sumner|
|fix(proxy): allow empty string |
|Fixes #5461 by @Jarred-Sumner|
|Fixes #5465 by @Jarred-Sumner|
Thanks to Bun's newest contributors!