---
title: "Bun v1.0.31"
description: "Bun v1.0.31 adds `bun --print` (Node-compatible eval with top-level await, TypeScript and JSX), running code from stdin via `bun run -`, `bun add --trust` plus `bun pm untrusted`/`trust` for managing blocked postinstall scripts, and `fetch()`/`node:http` support for Unix and Linux abstract domain sockets."
url: "https://swe.quest/articles/bun-v1-0-31-9173b12d836487e8"
canonical: "https://bun.com/blog/bun-v1.0.31"
source: "Bun"
published: "2024-03-14"
difficulty: "medium"
kind: "Release"
reading_minutes: 10
tags: ["javascript","runtimes","supply-chain-security","linux"]
---

# Bun v1.0.31

A post on [Bun](https://swe.quest/sources/bun.md), published 2024-03-14, 10 min read, Release. Original: [https://bun.com/blog/bun-v1.0.31](https://bun.com/blog/bun-v1.0.31)

## Summary

Bun v1.0.31 adds \`bun --print\` (Node-compatible eval with top-level await, TypeScript and JSX), running code from stdin via \`bun run -\`, \`bun add --trust\` plus \`bun pm untrusted\`/\`trust\` for managing blocked postinstall scripts, and \`fetch()\`/\`node:http\` support for Unix and Linux abstract domain sockets. A 100% CPU bug in \`Bun.spawn()\` on pre-5.10 Linux kernels came from the SIGCHLD fallback never reading its eventfd, which also masked a broken signal handler; a CPU-time regression test now guards it. A build mistake that statically linked all of ICU on macOS, inflating the binary from 47.7 MB to 80.4 MB, is fixed. Streaming file I/O and process spawning were reimplemented to avoid blocking the main thread without a threadpool, alongside Node.js compatibility and bunx/install fixes.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)
- [Supply chain security](https://swe.quest/tags/supply-chain-security.md) (Security)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)

## Prerequisites

- JavaScript runtimes ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- npm lifecycle scripts
- Unix sockets

## Keywords

Bun, Node.js, pidfd\_open, SIGCHLD, ICU, Unix domain sockets, trustedDependencies

## Related posts

- [Bun v1.0.30](https://swe.quest/articles/bun-v1-0-30-809370fb784e3d50.md): Bun · 2024-03-04 · Medium · 7 min read · JavaScript, Runtimes & VMs, Testing, Debugging
  Bun v1.0.30 fixes 27 bugs, including an 8x performance regression in Bun.serve() when a direct ReadableStream writes exactly one chunk in a single event-loop tick, introduced in v1.0.4.
- [Bun v1.1.34](https://swe.quest/articles/bun-v1-1-34-d8b685a5be9be177.md): Bun · 2024-11-02 · Medium · 7 min read · JavaScript, Runtimes & VMs, Build systems
  Bun v1.1.34 fixes 64 bugs and adds Bun.randomUUIDv7() for sortable, database-friendly IDs, more aggressive garbage collection while idle in the event loop to cut memory in long-running processes, and Node-API type tagging (napi\_type\_tag\_object/napi\_check\_object\_type\_tag) that unblocks tree-sitter.
- [Bun v1.0.36](https://swe.quest/articles/bun-v1-0-36-17df886795015fcd.md): Bun · 2024-03-29 · Medium · 6 min read · JavaScript, Runtimes & VMs, Linux
  Bun v1.0.36 fixes 13 bugs and adds Node.js-compatible fs.openAsBlob and fs.opendir.
- [Bun v0.8.1](https://swe.quest/articles/bun-v0-8-1-ecd25e5146563167.md): Bun · 2023-08-26 · Medium · 6 min read · Runtimes & VMs, JavaScript, Performance engineering, Memory management
  Bun v0.8.1 adds unix domain socket support to Bun.serve() via a new \`unix\` option and fixes a 2.8x request-body throughput regression from v0.8.0 (about 38.6k to 110k req/s).
- [Bun v1.0.8](https://swe.quest/articles/bun-v1-0-8-561e5f115e18943c.md): Bun · 2023-11-02 · Medium · 7 min read · JavaScript, Runtimes & VMs, Testing
  Bun v1.0.8 fixes 138 bugs, fixes a require() memory leak (introduced when built-in modules moved from ESM to CommonJS) that cuts memory up to 30%, and adds runtime module mocking to bun test via mock.module, which updates existing ESM and CJS imports in place. bun install no longer duplicates peer dependencies and now orders pre-release tags by semver precedence.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
