bun v0.0.78
To upgrade:
bun upgradeWhat's new:
You can now import from "bun" in bun.js. You can still use the global Bun.
Before:
await Bun.write("output.txt", Bun.file("input.txt"))After:
import {write, file} from 'bun';
await write("output.txt", file("input.txt"))This isn't a breaking change – you can still use Bun as a global same as before.
How it works
Bun's JavaScript printer replaces the "bun" import specifier with globalThis.Bun.
var {write, file} = globalThis.Bun;
await write("output.txt", file("input.txt"))You'll probably want to update types too:
bun add bun-typesBug fixes
- [fs] Add missing
isFileandisDirectoryfunctions tofs.stat()
7cd3d13 - [js parser] Fix a code simplification bug that could happen when using
!and comma operator - 4de7978 - [bun bun] Fix using
bun bunwith--platform=bunset - 43b1866
Bug fixes from v0.0.77
- [bun dev] Fix race condition in file watcher
- [bun install] Fix falling back to copyfile when hardlink fails on linux due to differing filesystems - 74309a1
- [Bun.serve] When a
Bun.fileis not found and the error handler is not run, the default status code is now 404 - [Bun.serve] Fix hanging when
Bun.filesent with sendfile and the request aborts or errors - [Bun.serve] Decrement the reference count for
FileBlobsent via sendfile after the callback completes instead of before - [Bun.serve] Serve
.tsand.tsxfiles withtext/javascriptmime type by default instead of MPEG2 Video