bun - bun-v0.0.78

To upgrade:

bun upgrade

What's new:

You can now import from "bun" in bun.js. You can still use the global Bun.


await Bun.write("output.txt", Bun.file("input.txt"))


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 and isDirectory functions to fs.stat()
  • [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 with text/javascript mime type by default instead of MPEG2 Video


April 10, 2022, 12:52 p.m.
bun v0.0.78
Register or login to:
  • 🔍View and search all bun releases.
  • 🛠️Create and share lists to track your tools.
  • 🚨Setup notifications for major, security, feature or patch updates.
  • 🚀Much more coming soon!
Continue with GitHub
Continue with Google