github oven-sh/bun bun-v0.0.78
bun v0.0.78

latest releases: bun-v1.1.6, bun-v1.1.5, bun-v1.1.4...
2 years ago

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 and isDirectory functions to fs.stat()
    7cd3d13
  • [js parser] Fix a code simplification bug that could happen when using ! and comma operator - 4de7978
  • [bun bun] Fix using bun bun with --platform=bun set - 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.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

Don't miss a new bun release

NewReleases is sending notifications on new releases.