Bun
https://gyazo.com/6f1645e87a6b39731ab9f6b607066ccc
「Bun」を訳すと「饅頭」
高速なJavaScript Runtime
website
github
Zig実装
特徴
JavaScriptのPackage Managerでありつつ、package manager, bundler, test runnerなども内包する
JS EngineにはJavaScriptCore (JSC)を使用している
TypeScriptがfirst-classで使える
Node.jsと互換性がある
nodejsのAPIが使用できる
λ bun test
BunのWorkspaces
Bun Macros
BunPlugin
Bun $ Shell
BunのFFI
BunのDebugger
Bun.js v1.0
#WIP
https://bun.com/blog/behind-the-scenes-of-bun-install
速い理由
syscallの最小化
OS ネイティブなコピー
SoA
I/Oの抽象化
macはkqueue、linuxはio_uring
Bunのroadmap
https://github.com/oven-sh/bun/issues/159
SQLiteを最初から同梱している
code:ts
import sqlite from "bun:sqlite";
https://www.publickey1.jp/blog/22/javascriptbun9ovenci.html
Oven.inc
https://www.ai-shift.co.jp/techblog/3113
中身
TinyCC
Bunの非互換な拡張API
https://www.youtube.com/watch?v=BG7pDo8kkUk
https://speakerdeck.com/yosuke_furukawa/bun-first-impressions
非常に良いmrsekut.icon*2
setup-bun
https://github.com/oven-sh/setup-bun
BunをGitHub Actionで使う
Bunの環境変数
https://bun.sh/docs/runtime/env
docs
Intro
What is Bun?
Installation
Quickstart
TypeScript
Templating
bun init
bun create
Runtime
bun run
File types
TypeScript
JSX
Environment variables
Bun APIs
Web APIs
Node.js compatibility
Single-file executable
Plugins
Watch mode
Module resolution
Auto-install
bunfig.toml
Debugger
Package manager
bun add
bun remove
bun update
bun link
bun pm
Global cache
Workspaces
Lifecycle scripts
Filter
Lockfile
Scopes and registries
Overrides and resolutions
Patch dependencies
.npmrc support
Bundler
Bun.build
Loaders
Plugins
Macros
vs esbuild
Package runner
bunx
API
Bun.serve()
WebSockets
Workers
Binary data
Streams
bun/File IO
import.meta
SQLite
FileSystemRouter
TCP sockets
UDP sockets
Globals
Shell
Child processes
Transpiler
Hashing
Console
FFI
HTMLRewriter
Testing
Utils
Node-API
Glob
DNS
Semver