
Bun is a fast, all-in-one toolkit for installing, bundling, running and testing JavaScript & TypeScript. To install: `npm i -g bun`
- Tweets4.2K
- Following7
- Followers83.7K
- Likes5.6K

ALT Bar charts titled "Time to compress 1 MB". Shorter is better. Brotli, 32x faster than Bun 1.4.4: Bun 1.5 42 ms, Bun 1.4.4 1.33 s, Node 26 1.37 s. gzip, 5.7x faster than Bun 1.4.4: Bun 1.5 2.24 ms, Bun 1.4.4 12.7 ms, Node 26 18.9 ms. zstd, 2.3x faster than Bun 1.4.4: Bun 1.5 1.29 ms, Node 26 2.96 ms, Bun 1.4.4 3.01 ms. Linux x64, AMD EPYC (Zen 4), one core, 1 MB inputs, geometric mean of JS, JSON, HTML, text and a binary, best of 4 runs.

ALT Bar charts titled "Time to decompress 1 MB". Shorter is better. gzip, 3.3x faster than Bun 1.4.4: Bun 1.5 0.43 ms, Bun 1.4.4 1.43 ms, Node 26 1.65 ms. zstd, 2.4x faster than Bun 1.4.4: Bun 1.5 0.37 ms, Node 26 0.79 ms, Bun 1.4.4 0.88 ms. Brotli, 2.3x faster than Bun 1.4.4: Bun 1.5 0.81 ms, Node 26 1.85 ms, Bun 1.4.4 1.89 ms. Linux x64, AMD EPYC (Zen 4), one core, 1 MB inputs, geometric mean of JS, JSON, HTML, text and a binary, best of 4 runs.
![Code on the left, terminal output on the right. Code: const a = await Bun.file("old/package.json").text(); const b = await Bun.file("new/package.json").text(); const patch = Bun.diff.createPatch(a, b); console.log(patch); Bun.diff.applyPatch(a, patch); // === b Bun.diff.parsePatch(patch); Bun.diff.lines(a, b); Bun.diff.hunks(a, b); Bun.diff.words("node index.js", "bun index.ts"); Bun.diff.chars("color", "colour"); Bun.diff.arrays([1, 2, 3], [1, 3, 4]); Output of "bun diff.ts": a unified diff of package.json where the "start" script changes from "node index.js" to "bun index.ts" and the "test" script changes from "jest" to "bun test".](https://pbs.twimg.com/media/HXy-67naMAAOWdI.jpg?name=small&format=webp)
ALT Code on the left, terminal output on the right. Code: const a = await Bun.file("old/package.json").text(); const b = await Bun.file("new/package.json").text(); const patch = Bun.diff.createPatch(a, b); console.log(patch); Bun.diff.applyPatch(a, patch); // === b Bun.diff.parsePatch(patch); Bun.diff.lines(a, b); Bun.diff.hunks(a, b); Bun.diff.words("node index.js", "bun index.ts"); Bun.diff.chars("color", "colour"); Bun.diff.arrays([1, 2, 3], [1, 3, 4]); Output of "bun diff.ts": a unified diff of package.json where the "start" script changes from "node index.js" to "bun index.ts" and the "test" script changes from "jest" to "bun test".





















