Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bun-types

Package Overview
Dependencies
Maintainers
3
Versions
789
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-types - npm Package Compare versions

Comparing version 1.1.44-canary.20250115T140647 to 1.1.44-canary.20250116T140538

docs/bundler/fullstack.md

2

docs/api/fetch.md

@@ -198,3 +198,3 @@ Bun implements the WHATWG `fetch` standard, with some extensions to meet the needs of server-side JavaScript.

[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.1.44-canary.20250115T140647
[fetch] > User-Agent: Bun/1.1.44-canary.20250116T140538
[fetch] > Accept: */*

@@ -201,0 +201,0 @@ [fetch] > Host: example.com

Production servers often read, upload, and write files to S3-compatible object storage services instead of the local filesystem. Historically, that means local filesystem APIs you use in development can't be used in production. When you use Bun, things are different.
{% callout %}
### Bun's S3 API is fast
{% image src="https://bun.sh/bun-s3-node.gif" alt="Bun's S3 API is fast" caption="Left: Bun v1.1.44. Right: Node.js v23.6.0" /%}
{% /callout %}
Bun provides fast, native bindings for interacting with S3-compatible object storage services. Bun's S3 API is designed to be simple and feel similar to fetch's `Response` and `Blob` APIs (like Bun's local filesystem APIs).

@@ -4,0 +12,0 @@

@@ -113,3 +113,3 @@ Spawn child processes with `Bun.spawn` or `Bun.spawnSync`.

const text = await new Response(proc.stdout).text();
console.log(text); // => "1.1.44-canary.20250115T140647"
console.log(text); // => "1.1.44-canary.20250116T140538"
```

@@ -116,0 +116,0 @@

@@ -294,3 +294,3 @@ Bun provides a universal plugin API that can be used to extend both the _runtime_ and _bundler_.

Native plugins are written as [NAPI](/docs/node-api) modules and can be run on multiple threads. This allows native plugins to run much faster than JavaScript plugins.
Native plugins are written as [NAPI](https://bun.sh/docs/api/node-api) modules and can be run on multiple threads. This allows native plugins to run much faster than JavaScript plugins.

@@ -297,0 +297,0 @@ In addition, native plugins can skip unnecessary work such as the UTF-8 -> UTF-16 conversion needed to pass strings to JavaScript.

@@ -96,3 +96,3 @@ The `bun` CLI contains a Node.js-compatible package manager designed to be a dramatically faster replacement for `npm`, `yarn`, and `pnpm`. It's a standalone tool that will work in pre-existing Node.js projects; if your project has a `package.json`, `bun install` can help you speed up your workflow.

For more information on filtering with `bun install`, refer to [Package Manager > Filtering](https://bun.sh/docs/cli/install#bun-install-and-bun-outdated)
For more information on filtering with `bun install`, refer to [Package Manager > Filtering](https://bun.sh/docs/cli/filter#bun-install-and-bun-outdated)

@@ -99,0 +99,0 @@ ## Overrides and resolutions

@@ -10,3 +10,3 @@ Use `bun publish` to publish a package to the npm registry.

## Output
bun publish v1.1.44-canary.20250115T140647 (ca7428e9)
bun publish v1.1.44-canary.20250116T140538 (ca7428e9)

@@ -13,0 +13,0 @@ packed 203B package.json

Bun is an all-in-one toolkit for JavaScript and TypeScript apps. It ships as a single executable called `bun`.
At its core is the _Bun runtime_, a fast JavaScript runtime designed as a drop-in replacement for Node.js. It's written in Zig and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage.
At its core is the _Bun runtime_, a fast JavaScript runtime designed as **a drop-in replacement for Node.js**. It's written in Zig and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage.

@@ -5,0 +5,0 @@ ```bash

@@ -13,3 +13,3 @@ Bun supports loading configuration options from [`.npmrc`](https://docs.npmjs.com/cli/v10/configuring-npm/npmrc) files, allowing you to reuse existing registry/scope configurations.

The default registry is used to resolve packages, it's default value is `npm`'s official registry (`https://registry.npmjs.org/`).
The default registry is used to resolve packages, its default value is `npm`'s official registry (`https://registry.npmjs.org/`).

@@ -16,0 +16,0 @@ To change it, you can set the `registry` option in `.npmrc`:

@@ -127,7 +127,7 @@ ---

```sh
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.1.44-canary.20250115T140647" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.1.44-canary.20250116T140538" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
[fetch] > HTTP/1.1 POST https://example.com/
[fetch] > content-type: application/json
[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.1.44-canary.20250115T140647
[fetch] > User-Agent: Bun/1.1.44-canary.20250116T140538
[fetch] > Accept: */*

@@ -174,3 +174,3 @@ [fetch] > Host: example.com

[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.1.44-canary.20250115T140647
[fetch] > User-Agent: Bun/1.1.44-canary.20250116T140538
[fetch] > Accept: */*

@@ -177,0 +177,0 @@ [fetch] > Host: example.com

@@ -1,7 +0,9 @@

Bun aims for complete Node.js API compatibility. Most `npm` packages intended for `Node.js` environments will work with Bun out of the box; the best way to know for certain is to try it.
Every day, Bun gets closer to 100% Node.js API compatibility. Today, popular frameworks like Next.js, Express, and millions of `npm` packages intended for Node just work with Bun. To ensure compatibility, we run thousands of tests from Node.js' test suite before every release of Bun.
This page is updated regularly to reflect compatibility status of the latest version of Bun. The information below reflects Bun's compatibility with _Node.js v20_. If you run into any bugs with a particular package, please [open an issue](https://bun.sh/issues). Opening issues for compatibility bugs helps us prioritize what to work on next.
**If a package works in Node.js but doesn't work in Bun, we consider it a bug in Bun.** Please [open an issue](https://bun.sh/issues) and we'll fix it.
## Built-in modules
This page is updated regularly to reflect compatibility status of the latest version of Bun. The information below reflects Bun's compatibility with _Node.js v23_.
## Built-in Node.js modules
### [`node:assert`](https://nodejs.org/api/assert.html)

@@ -11,6 +13,2 @@

### [`node:async_hooks`](https://nodejs.org/api/async_hooks.html)
🟡 Only `AsyncLocalStorage`, and `AsyncResource` are implemented. `AsyncResource` is missing `bind`.
### [`node:buffer`](https://nodejs.org/api/buffer.html)

@@ -20,10 +18,2 @@

### [`node:child_process`](https://nodejs.org/api/child_process.html)
🟡 Missing `proc.gid` `proc.uid`. `Stream` class not exported. IPC cannot send socket handles. Node.js <> Bun IPC can be used with JSON serialization.
### [`node:cluster`](https://nodejs.org/api/cluster.html)
🟡 Handles and file descriptors cannot be passed between workers, which means load-balancing HTTP requests across processes is only supported on Linux at this time (via `SO_REUSEPORT`). Otherwise, implemented but not battle-tested.
### [`node:console`](https://nodejs.org/api/console.html)

@@ -33,13 +23,2 @@

### [`node:crypto`](https://nodejs.org/api/crypto.html)
🟡 Missing `Certificate` `ECDH` `X509Certificate` `checkPrime` `checkPrimeSync` `diffieHellman` `generatePrime` `generatePrimeSync` `getCipherInfo` `getFips` `hkdf` `hkdfSync` `secureHeapUsed` `setEngine` `setFips`
Some methods are not optimized yet.
### [`node:dgram`](https://nodejs.org/api/dgram.html)
🟡 Missing `setBroadcast` `setTTL` `setMulticastTTL` `setMulticastLoopback` `setMulticastInterface` `addMembership` `dropMembership`
`addSourceSpecificMembership` `dropSourceSpecificMembership`
### [`node:diagnostics_channel`](https://nodejs.org/api/diagnostics_channel.html)

@@ -51,108 +30,119 @@

🟡 Missing `cancel` `setServers` `getDefaultResultOrder`
🟢 Fully implemented. > 90% of Node.js's test suite passes.
### [`node:domain`](https://nodejs.org/api/domain.html)
### [`node:events`](https://nodejs.org/api/events.html)
🟡 Missing `Domain` `active`
🟢 Fully implemented. `EventEmitterAsyncResource` uses `AsyncResource` underneath. 100% of Node.js's test suite for EventEmitter passes.
### [`node:events`](https://nodejs.org/api/events.html)
### [`node:http`](https://nodejs.org/api/http.html)
🟢 Fully implemented. `EventEmitterAsyncResource` uses `AsyncResource` underneath.
🟢 Fully implemented. Outgoing client request body is currently buffered instead of streamed.
### [`node:fs`](https://nodejs.org/api/fs.html)
### [`node:https`](https://nodejs.org/api/https.html)
🟡 Missing `statfs` `statfsSync`, `opendirSync`. `Dir` is partially implemented.
🟢 APIs are implemented, but `Agent` is not always used yet.
### [`node:http`](https://nodejs.org/api/http.html)
### [`node:os`](https://nodejs.org/api/os.html)
🟢 Fully implemented. Outgoing client request body is currently buffered instead of streamed.
🟢 Fully implemented. 100% of Node.js's test suite passes.
### [`node:http2`](https://nodejs.org/api/http2.html)
### [`node:path`](https://nodejs.org/api/path.html)
🟡 Client & server are implemented (95.25% of gRPC's test suite passes). Missing `options.allowHTTP1`, `options.enableConnectProtocol`, ALTSVC extension, and `http2stream.pushStream`.
🟢 Fully implemented. 100% of Node.js's test suite passes.
### [`node:https`](https://nodejs.org/api/https.html)
### [`node:punycode`](https://nodejs.org/api/punycode.html)
🟢 APIs are implemented, but `Agent` is not always used yet.
🟢 Fully implemented. 100% of Node.js's test suite passes, _deprecated by Node.js_.
### [`node:inspector`](https://nodejs.org/api/inspector.html)
### [`node:querystring`](https://nodejs.org/api/querystring.html)
🔴 Not implemented.
🟢 Fully implemented. 100% of Node.js's test suite passes.
### [`node:module`](https://nodejs.org/api/module.html)
### [`node:readline`](https://nodejs.org/api/readline.html)
🟡 Missing `runMain` `syncBuiltinESMExports`, `Module#load()`. Overriding `require.cache` is supported for ESM & CJS modules. `module._extensions`, `module._pathCache`, `module._cache` are no-ops. `module.register` is not implemented and we recommend using a [`Bun.plugin`](https://bun.sh/docs/runtime/plugins) in the meantime.
🟢 Fully implemented.
### [`node:net`](https://nodejs.org/api/net.html)
### [`node:string_decoder`](https://nodejs.org/api/string_decoder.html)
🟡 `SocketAddress` class not exposed (but implemented). `BlockList` exists but is a no-op.
🟢 Fully implemented. 100% of Node.js's test suite passes.
### [`node:os`](https://nodejs.org/api/os.html)
### [`node:timers`](https://nodejs.org/api/timers.html)
🟢 Recommended to use global `setTimeout`, et. al. instead.
### [`node:tty`](https://nodejs.org/api/tty.html)
🟢 Fully implemented.
### [`node:path`](https://nodejs.org/api/path.html)
### [`node:url`](https://nodejs.org/api/url.html)
🟢 Fully implemented.
### [`node:perf_hooks`](https://nodejs.org/api/perf_hooks.html)
### [`node:zlib`](https://nodejs.org/api/zlib.html)
🟡 Missing `createHistogram` `monitorEventLoopDelay`. It's recommended to use `performance` global instead of `perf_hooks.performance`.
🟢 Fully implemented. 98% of Node.js's test suite passes.
### [`node:process`](https://nodejs.org/api/process.html)
### [`node:async_hooks`](https://nodejs.org/api/async_hooks.html)
🟡 See [`process`](#process) Global.
🟡 `AsyncLocalStorage`, and `AsyncResource` are implemented. `AsyncResource` is missing `bind`. v8 hooks are stubbed.
### [`node:punycode`](https://nodejs.org/api/punycode.html)
### [`node:child_process`](https://nodejs.org/api/child_process.html)
🟢 Fully implemented. _Deprecated by Node.js._
🟡 Missing `proc.gid` `proc.uid`. `Stream` class not exported. IPC cannot send socket handles. Node.js <> Bun IPC can be used with JSON serialization.
### [`node:querystring`](https://nodejs.org/api/querystring.html)
### [`node:cluster`](https://nodejs.org/api/cluster.html)
🟢 Fully implemented.
🟡 Handles and file descriptors cannot be passed between workers, which means load-balancing HTTP requests across processes is only supported on Linux at this time (via `SO_REUSEPORT`). Otherwise, implemented but not battle-tested.
### [`node:readline`](https://nodejs.org/api/readline.html)
### [`node:crypto`](https://nodejs.org/api/crypto.html)
🟢 Fully implemented.
🟡 Missing `Certificate` `ECDH` `X509Certificate` `checkPrime` `checkPrimeSync` `diffieHellman` `generatePrime` `generatePrimeSync` `getCipherInfo` `getFips` `hkdf` `hkdfSync` `secureHeapUsed` `setEngine` `setFips`
### [`node:repl`](https://nodejs.org/api/repl.html)
Some methods are not optimized yet.
🔴 Not implemented.
### [`node:dgram`](https://nodejs.org/api/dgram.html)
### [`node:stream`](https://nodejs.org/api/stream.html)
🟡 Missing `setBroadcast` `setTTL` `setMulticastTTL` `setMulticastLoopback` `setMulticastInterface` `addMembership` `dropMembership`
`addSourceSpecificMembership` `dropSourceSpecificMembership`
🟡 Missing `getDefaultHighWaterMark` `setDefaultHighWaterMark` `toWeb`
### [`node:domain`](https://nodejs.org/api/domain.html)
### [`node:string_decoder`](https://nodejs.org/api/string_decoder.html)
🟡 Missing `Domain` `active`
🟢 Fully implemented.
### [`node:fs`](https://nodejs.org/api/fs.html)
### [`node:sys`](https://nodejs.org/api/util.html)
🟡 Missing `statfs` `statfsSync`, `opendirSync`. `Dir` is partially implemented.
🟡 See [`node:util`](#node-util).
### [`node:http2`](https://nodejs.org/api/http2.html)
### [`node:test`](https://nodejs.org/api/test.html)
🟡 Client & server are implemented (95.25% of gRPC's test suite passes). Missing `options.allowHTTP1`, `options.enableConnectProtocol`, ALTSVC extension, and `http2stream.pushStream`.
🔴 Not implemented. Use [`bun:test`](https://bun.sh/docs/cli/test) instead.
### [`node:module`](https://nodejs.org/api/module.html)
### [`node:timers`](https://nodejs.org/api/timers.html)
🟡 Missing `runMain` `syncBuiltinESMExports`, `Module#load()`. Overriding `require.cache` is supported for ESM & CJS modules. `module._extensions`, `module._pathCache`, `module._cache` are no-ops. `module.register` is not implemented and we recommend using a [`Bun.plugin`](https://bun.sh/docs/runtime/plugins) in the meantime.
🟢 Recommended to use global `setTimeout`, et. al. instead.
### [`node:net`](https://nodejs.org/api/net.html)
### [`node:tls`](https://nodejs.org/api/tls.html)
🟡 `SocketAddress` class not exposed (but implemented). `BlockList` exists but is a no-op.
🟡 Missing `tls.createSecurePair`.
### [`node:perf_hooks`](https://nodejs.org/api/perf_hooks.html)
### [`node:trace_events`](https://nodejs.org/api/tracing.html)
🟡 Missing `createHistogram` `monitorEventLoopDelay`. It's recommended to use `performance` global instead of `perf_hooks.performance`.
🔴 Not implemented.
### [`node:process`](https://nodejs.org/api/process.html)
### [`node:tty`](https://nodejs.org/api/tty.html)
🟡 See [`process`](#process) Global.
🟢 Fully implemented.
### [`node:stream`](https://nodejs.org/api/stream.html)
### [`node:url`](https://nodejs.org/api/url.html)
🟡 Missing `toWeb`
🟢 Fully implemented.
### [`node:sys`](https://nodejs.org/api/util.html)
🟡 See [`node:util`](#node-util).
### [`node:tls`](https://nodejs.org/api/tls.html)
🟡 Missing `tls.createSecurePair`.
### [`node:util`](https://nodejs.org/api/util.html)

@@ -178,8 +168,24 @@

### [`node:zlib`](https://nodejs.org/api/zlib.html)
### [`node:inspector`](https://nodejs.org/api/inspector.html)
🟡 Partially optimized, but brotli uses too much memory right now.
🔴 Not implemented.
## Globals
### [`node:repl`](https://nodejs.org/api/repl.html)
🔴 Not implemented.
### [`node:sqlite`](https://nodejs.org/api/sqlite.html)
🔴 Not implemented.
### [`node:test`](https://nodejs.org/api/test.html)
🔴 Not implemented. Use [`bun:test`](https://bun.sh/docs/cli/test) instead.
### [`node:trace_events`](https://nodejs.org/api/tracing.html)
🔴 Not implemented.
## Node.js globals
The table below lists all globals implemented by Node.js and Bun's current compatibility status.

@@ -341,3 +347,3 @@

🔴 Not implemented.
🟢 Fully implemented.

@@ -350,3 +356,3 @@ ### [`performance`](https://developer.mozilla.org/en-US/docs/Web/API/performance)

🟡 Missing `initgroups` `allowedNodeEnvironmentFlags` `getActiveResourcesInfo` `setActiveResourcesInfo` `moduleLoadList` `setSourceMapsEnabled`. `process.binding` is partially implemented.
🟡 Mostly implemented. `process.binding` (internal Node.js bindings some packages rely on) is partially implemented. `process.title` is a currently a no-op on macOS & Linux. `getActiveResourcesInfo` `setActiveResourcesInfo`, `getActiveResources` and `setSourceMapsEnabled` are stubs. Newer APIs like `process.loadEnvFile` and `process.getBuiltinModule` are not implemented yet.

@@ -383,3 +389,3 @@ ### [`queueMicrotask()`](https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask)

🟢 Fully implemented, including [`require.main`](https://nodejs.org/api/modules.html#requiremain), [`require.cache`](https://nodejs.org/api/modules.html#requirecache), [`require.resolve`](https://nodejs.org/api/modules.html#requireresolverequest-options)
🟢 Fully implemented, including [`require.main`](https://nodejs.org/api/modules.html#requiremain), [`require.cache`](https://nodejs.org/api/modules.html#requirecache), [`require.resolve`](https://nodejs.org/api/modules.html#requireresolverequest-options). `require.extensions` is a stub.

@@ -386,0 +392,0 @@ ### [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)

@@ -58,3 +58,3 @@ Bun's test runner plays well with existing component and DOM testing libraries, including React Testing Library and [`happy-dom`](https://github.com/capricorn86/happy-dom).

$ bun test
bun test v1.1.44-canary.20250115T140647
bun test v1.1.44-canary.20250116T140538

@@ -61,0 +61,0 @@ dom.test.ts:

{
"version": "1.1.44-canary.20250115T140647",
"version": "1.1.44-canary.20250116T140538",
"name": "bun-types",

@@ -4,0 +4,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc