bun-v0.0.78
版本发布时间: 2022-04-10 20:52:23
oven-sh/bun最新发布版本:bun-v1.1.20(2024-07-13 14:04:45)
To upgrade:
bun upgrade
What'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-types
Bug fixes
- [fs] Add missing
isFile
andisDirectory
functions tofs.stat()
7cd3d1301128c1f9cdcfe5825b1fd34319ff0bdc - [js parser] Fix a code simplification bug that could happen when using
!
and comma operator - 4de7978b2763d95ddcded6ccda9b7b80cca7e8f1 - [bun bun] Fix using
bun bun
with--platform=bun
set - 43b18663fdc763c24ae8fa0940019f2aee37c6aa
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 - 74309a1f9e52a11f2809485f4fc58ef317a7203b
- [Bun.serve] When a
Bun.file
is not found and the error handler is not run, the default status code is now 404 - [Bun.serve] Fix hanging when
Bun.file
sent with sendfile and the request aborts or errors - [Bun.serve] Decrement the reference count for
FileBlob
sent via sendfile after the callback completes instead of before - [Bun.serve] Serve
.ts
and.tsx
files withtext/javascript
mime type by default instead of MPEG2 Video
1、 bun-darwin-aarch64.dSYM.tar.gz 14.65MB
2、 bun-darwin-aarch64.zip 11.34MB
3、 bun-darwin-x64.dSYM.tar.gz 15.44MB
4、 bun-darwin-x64.zip 13.57MB
5、 bun-linux-x64.zip 26.65MB