bun v0.0.81 #165
Jarred-Sumner
announced in
Announcements
bun v0.0.81
#165
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
To upgrade:
Bun.js gets Node-API support
Node-API is 1.75x - 3x faster in Bun compared to Node.js 18.
Getters & setters:

Simple function calls:

Just like in Node.js, to load a Node-API module, use
require('my-npm-package')or useprocess.dlopen.90% of the API is implemented, though it is certainly buggy right now.
Polyfills & new APIs in Bun.js v0.0.81
The following functions have been added:
import.meta.resolveSyncsynchronously run the module resolver for the currently-referenced fileimport.meta.requiresynchronously loads.nodeor.jsonmodules and works with dynamic paths. This doesn't use ESM and doesn't run the transpiler, which is why regular js files are not supported. This is mostly an implementation detail for howrequireworks for Node-API modules, but it could also be used outside of that if you wantBun.gzipSync,Bun.gunzipSync,Bun.inflateSync, andBun.deflateSyncwhich expose native bindings tozlib-cloudflare. On macOS aarch64,gzipSyncis ~3x faster than in Node. This isn't wired up to the"zlib"polyfill in bun yetAdditionally:
__dirnameis now supported for all targets (including browsers)__filenameis now supported for all targets (including browsers)Buffer.byteLengthis now implementedSeveral packages using Node-API also use
detect-libc. Bun polyfillsdetect-libcbecause bun doesn't supportchild_processyet and this improves performance a little.Bug fixes
new.targetis referenced outside of a constructor d1ea51eThis discussion was created from the release bun v0.0.81.
Beta Was this translation helpful? Give feedback.
All reactions