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.45 to 1.2.0-canary.20250122T140708

docs/api/sql.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/bun-v1.1.45
[fetch] > User-Agent: Bun/1.2.0-canary.20250122T140708
[fetch] > Accept: */*

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

@@ -71,3 +71,2 @@ 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.

// Bun.s3 is a global singleton that is equivalent to `new Bun.S3Client()`
Bun.s3 = client;
```

@@ -379,3 +378,3 @@

These defaults are overridden by the options you pass to `s3(credentials)`, `new Bun.S3Client(credentials)`, or any of the methods that accept credentials. So if, for example, you use the same credentials for different buckets, you can set the credentials once in your `.env` file and then pass `bucket: "my-bucket"` to the `s3()` helper function without having to specify all the credentials again.
These defaults are overridden by the options you pass to `s3.file(credentials)`, `new Bun.S3Client(credentials)`, or any of the methods that accept credentials. So if, for example, you use the same credentials for different buckets, you can set the credentials once in your `.env` file and then pass `bucket: "my-bucket"` to the `s3.file()` function without having to specify all the credentials again.

@@ -464,3 +463,3 @@ ### `S3Client` objects

`S3File` instances are created by calling the `S3` instance method or the `s3()` helper function. Like `Bun.file()`, `S3File` instances are lazy. They don't refer to something that necessarily exists at the time of creation. That's why all the methods that don't involve network requests are fully synchronous.
`S3File` instances are created by calling the `S3Client` instance method or the `s3.file()` function. Like `Bun.file()`, `S3File` instances are lazy. They don't refer to something that necessarily exists at the time of creation. That's why all the methods that don't involve network requests are fully synchronous.

@@ -488,3 +487,3 @@ ```ts

options?: BlobPropertyBag,
): Promise<void>;
): Promise<number>;

@@ -607,3 +606,5 @@ exists(options?: S3Options): Promise<boolean>;

```ts
const s3file = Bun.s3("my-file.txt", {
import { s3 } from "bun";
const s3file = s3.file("my-file.txt", {
...credentials,

@@ -610,0 +611,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); // => "bun-v1.1.45"
console.log(text); // => "1.2.0-canary.20250122T140708"
```

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

@@ -140,3 +140,4 @@ Bun exposes its internal transpiler via the `Bun.Transpiler` class. To create an instance of Bun's transpiler:

<!-- - `internal`: `import {foo} from 'bun:internal'`
- `entry-point`: `import {foo} from 'bun:entry'` -->
- `entry-point-build`: `import {foo} from 'bun:entry'`
- `entry-point-run`: `bun ./mymodule` -->

@@ -271,3 +272,4 @@ ## `.scanImports()`

// Entry point (not common)
| "entry-point"
| "entry-point-build"
| "entry-point-run"
}

@@ -274,0 +276,0 @@

@@ -37,6 +37,4 @@ As of Bun v1.1.44, we've added initial support for bundling frontend apps directly in Bun's HTTP server: `Bun.serve()`. Run your frontend and backend in the same app with no extra steps.

You'll need to run your app with `bun --experimental-html` to enable this feature:
```bash
$ bun --experimental-html run app.ts
$ bun run app.ts
```

@@ -202,2 +200,50 @@

## Plugins
Bun's [bundler plugins](https://bun.sh/docs/bundler/plugins) are also supported when bundling static routes.
To configure plugins for `Bun.serve`, add a `plugins` array in the `[serve.static]` section of your `bunfig.toml`.
### Using TailwindCSS in HTML routes
For example, enable TailwindCSS on your routes by adding add the `bun-plugin-tailwind` plugin:
```toml
[serve.static]
plugins = ["bun-plugin-tailwind"]
```
This will allow you to use TailwindCSS utility classes in your HTML and CSS files. All you need to do is import `tailwindcss` somewhere:
```html
<!-- index.html -->
<!doctype html>
<html>
<head>
<title>Home</title>
<link rel="stylesheet" href="tailwindcss" />
</head>
<body>
<!-- the rest of your HTML... -->
</body>
</html>
```
Or in your CSS:
```css
/* style.css */
@import "tailwindcss";
```
Any JS file or module which exports a [valid bundler plugin object](https://bun.sh/docs/bundler/plugins#usage) (essentially an object with a `name` and `setup` field) can be placed inside the `plugins` array:
```toml
[serve.static]
plugins = ["./my-plugin-implementation.ts"]
```
Bun will lazily resolve and load each plugin and use them to bundle your routes.
## How this works

@@ -249,2 +295,1 @@

- This doesn't support `bun build` yet. It also will in the future.
- We haven't figured out plugins yet. This probably will live in `bunfig.toml` with the same API as in `Bun.build` otherwise.

@@ -21,3 +21,3 @@ As of Bun v1.1.43, Bun's bundler now has first-class support for HTML. Build static sites, landing pages, and web applications with zero configuration. Just point Bun at your HTML file and it handles everything else.

```bash#CLI
$ bun build --experimental-html --experimental-css ./index.html --outdir=dist
$ bun build ./index.html --outdir=dist
```

@@ -29,6 +29,2 @@

outdir: "./dist",
// On by default in Bun v1.2+
html: true,
experimentalCss: true,
});

@@ -68,4 +64,2 @@ ```

outdir: "./dist",
html: true,
experimentalCss: true,
minify: true,

@@ -72,0 +66,0 @@

@@ -536,3 +536,4 @@ Bun's fast native bundler is now in beta. It can be used via the `bun build` CLI command or the `Bun.build()` JavaScript API.

export type ImportKind =
| "entry-point"
| "entry-point-build"
| "entry-point-run"
| "import-statement"

@@ -1261,26 +1262,2 @@ | "require-call"

### `experimentalCss`
Whether to enable _experimental_ support for bundling CSS files. Defaults to `false`. In 1.2, this property will be deleted, and CSS bundling will always be enabled.
This supports bundling CSS files imported from JS, as well as CSS entrypoints.
{% codetabs group="a" %}
```ts#JavaScript
const result = await Bun.build({
entrypoints: ["./index.ts"],
experimentalCss: true,
});
// => { success: boolean, outputs: BuildArtifact[], logs: BuildMessage[] }
```
{% /codetabs %}
### `throw`
If set to `true`, `Bun.build` will throw on build failure. See the section ["Logs and Errors"](#logs-and-errors) for more details on the error message structure.
In 1.2, this will default to `true`, with the previous behavior as `throw: false`
## Outputs

@@ -1426,4 +1403,5 @@

<!-- 1.2 documentation -->
<!-- On failure, `Bun.build` returns a rejected promise with an `AggregateError`. This can be logged to the console for pretty printing of the error list, or programmatically read with a `try`/`catch` block.
On failure, `Bun.build` returns a rejected promise with an `AggregateError`. This can be logged to the console for pretty printing of the error list, or programmatically read with a `try`/`catch` block.
```ts

@@ -1487,68 +1465,4 @@ try {

}
``` -->
By default, `Bun.build` only throws if invalid options are provided. Read the `success` property to determine if the build was successful; the `logs` property will contain additional details.
```ts
const result = await Bun.build({
entrypoints: ["./index.tsx"],
outdir: "./out",
});
if (!result.success) {
console.error("Build failed");
for (const message of result.logs) {
// Bun will pretty print the message object
console.error(message);
}
}
```
Each message is either a `BuildMessage` or `ResolveMessage` object, which can be used to trace what problems happened in the build.
```ts
class BuildMessage {
name: string;
position?: Position;
message: string;
level: "error" | "warning" | "info" | "debug" | "verbose";
}
class ResolveMessage extends BuildMessage {
code: string;
referrer: string;
specifier: string;
importKind: ImportKind;
}
```
If you want to throw an error from a failed build, consider passing the logs to an `AggregateError`. If uncaught, Bun will pretty-print the contained messages nicely.
```ts
if (!result.success) {
throw new AggregateError(result.logs, "Build failed");
}
```
In Bun 1.2, throwing an aggregate error like this will become the default beahavior. You can opt-into it early using the `throw: true` option.
```ts
try {
const result = await Bun.build({
entrypoints: ["./index.tsx"],
outdir: "./out",
});
} catch (e) {
// TypeScript does not allow annotations on the catch clause
const error = e as AggregateError;
console.error("Build Failed");
// Example: Using the built-in formatter
console.error(error);
// Example: Serializing the failure as a JSON string.
console.error(JSON.stringify(error, null, 2));
}
```
## Reference

@@ -1653,9 +1567,2 @@

/**
* **Experimental**
*
* Enable CSS support.
*/
experimentalCss?: boolean;
/**
* Drop function calls to matching property accesses.

@@ -1662,0 +1569,0 @@ */

@@ -155,15 +155,2 @@ The Bun bundler implements a set of default loaders out of the box. As a rule of thumb, the bundler and the runtime both support the same set of file types out of the box.

### `wasm`
**WebAssembly loader**. Default for `.wasm`.
In the runtime, WebAssembly files can be directly imported. The file is read and returned as a `WebAssembly.Module`.
```ts
import wasm from "./module.wasm";
console.log(wasm); // => WebAssembly.Module
```
In the bundler, `.wasm` files are handled using the [`file`](#file) loader.
### `napi`

@@ -211,9 +198,2 @@

To enable the html loader:
- For `Bun.build`: set `html: true`
- For `bun build`: `--experimental-html` CLI flag
You most likely want to use the `html` loader in conjunction with `experimentalCss: true` or `--experimental-css`.
The html loader processes HTML files and bundles any referenced assets. It will:

@@ -220,0 +200,0 @@

@@ -98,3 +98,3 @@ ### `bun install`

# Print a yarn v1 lockfile
# Note: it does not load the lockfile, it just converts bun.lockb into a yarn.lock
# Note: it does not load the lockfile, it just converts bun.lock into a yarn.lock
print = "yarn"

@@ -174,5 +174,5 @@

When a `bun.lockb` doesn’t exist or `package.json` has changed dependencies, tarballs are downloaded & extracted eagerly while resolving.
When a `bun.lock` doesn’t exist or `package.json` has changed dependencies, tarballs are downloaded & extracted eagerly while resolving.
When a `bun.lockb` exists and `package.json` hasn’t changed, Bun downloads missing dependencies lazily. If the package with a matching `name` & `version` already exists in the expected location within `node_modules`, Bun won’t attempt to download the tarball.
When a `bun.lock` exists and `package.json` hasn’t changed, Bun downloads missing dependencies lazily. If the package with a matching `name` & `version` already exists in the expected location within `node_modules`, Bun won’t attempt to download the tarball.

@@ -189,20 +189,6 @@ ## Platform-specific dependencies?

`bun.lockb` is Bun’s binary lockfile format.
`bun.lock` is Bun’s lockfile format. See [our blogpost about the text lockfile](https://bun.sh/blog/bun-lock-text-lockfile).
## Why is it binary?
Prior to Bun 1.2, the lockfile was binary and called `bun.lockb`. Old lockfiles can be upgraded to the new format by running `bun install --save-text-lockfile --frozen-lockfile --lockfile-only`, and then deleting `bun.lockb`.
In a word: Performance. Bun’s lockfile saves & loads incredibly quickly, and saves a lot more data than what is typically inside lockfiles.
## How do I inspect it?
For now, the easiest thing is to run `bun install -y`. That prints a Yarn v1-style yarn.lock file.
## What does the lockfile store?
Packages, metadata for those packages, the hoisted install order, dependencies for each package, what packages those dependencies resolved to, an integrity hash (if available), what each package was resolved to and which version (or equivalent).
## Why is it fast?
It uses linear arrays for all data. [Packages](https://github.com/oven-sh/bun/blob/be03fc273a487ac402f19ad897778d74b6d72963/src/install/install.zig#L1825) are referenced by an auto-incrementing integer ID or a hash of the package name. Strings longer than 8 characters are de-duplicated. Prior to saving on disk, the lockfile is garbage-collected & made deterministic by walking the package tree and cloning the packages in dependency order.
## Cache

@@ -209,0 +195,0 @@

@@ -36,3 +36,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.

- **Run** your project's `{pre|post}install` and `{pre|post}prepare` scripts at the appropriate time. For security reasons Bun _does not execute_ lifecycle scripts of installed dependencies.
- **Write** a `bun.lockb` lockfile to the project root.
- **Write** a `bun.lock` lockfile to the project root.

@@ -140,3 +140,3 @@ ## Logging

For reproducible installs, use `--frozen-lockfile`. This will install the exact versions of each package specified in the lockfile. If your `package.json` disagrees with `bun.lockb`, Bun will exit with an error. The lockfile will not be updated.
For reproducible installs, use `--frozen-lockfile`. This will install the exact versions of each package specified in the lockfile. If your `package.json` disagrees with `bun.lock`, Bun will exit with an error. The lockfile will not be updated.

@@ -147,3 +147,3 @@ ```bash

For more information on Bun's binary lockfile `bun.lockb`, refer to [Package manager > Lockfile](https://bun.sh/docs/install/lockfile).
For more information on Bun's lockfile `bun.lock`, refer to [Package manager > Lockfile](https://bun.sh/docs/install/lockfile).

@@ -150,0 +150,0 @@ ## Omitting dependencies

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

## Output
bun publish vbun-v1.1.45 (ca7428e9)
bun publish v1.2.0-canary.20250122T140708 (ca7428e9)

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

@@ -109,3 +109,3 @@ The `bun` CLI can be used to execute JavaScript/TypeScript files, `package.json` scripts, and [executable packages](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#bin).

Bun executes the script command in a subshell. It checks for the following shells in order, using the first one it finds: `bash`, `sh`, `zsh`.
Bun executes the script command in a subshell. On Linux & macOS, it checks for the following shells in order, using the first one it finds: `bash`, `sh`, `zsh`. On windows, it uses [bun shell](https://bun.sh/docs/runtime/shell) to support bash-like syntax and many common commands.

@@ -116,3 +116,3 @@ {% callout %}

If there is a name conflict between a `package.json` script and a built-in `bun` command (`install`, `dev`, `upgrade`, etc.) Bun's built-in command takes precedence. In this case, use the more explicit `bun run` command to execute your package script.
Scripts can also be run with the shorter command `bun <script>`, however if there is a built-in bun command with the same name, the built-in command takes precedence. In this case, use the more explicit `bun run <script>` command to execute your package script.

@@ -199,1 +199,12 @@ ```bash

This causes the garbage collector to run more frequently, which can slow down execution. However, it can be useful in environments with limited memory. Bun automatically adjusts the garbage collector's heap size based on the available memory (accounting for cgroups and other memory limits) with and without the `--smol` flag, so this is mostly useful for cases where you want to make the heap size grow more slowly.
## Resolution order
Absolute paths and paths starting with `./` or `.\\` are always executed as source files. Unless using `bun run`, running a file with an allowed extension will prefer the file over a package.json script.
When there is a package.json script and a file with the same name, `bun run` prioritizes the package.json script. The full resolution order is:
1. package.json scripts, eg `bun run build`
2. Source files, eg `bun run src/main.js`
3. Binaries from project packages, eg `bun add eslint && bun run eslint`
4. (`bun run` only) System commands, eg `bun run ls`

@@ -25,3 +25,3 @@ ---

RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
COPY package.json bun.lock /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile

@@ -31,3 +31,3 @@

RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
COPY package.json bun.lock /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production

@@ -34,0 +34,0 @@

@@ -56,3 +56,3 @@ ---

```sh
$ git add app.ts bun.lockb package.json
$ git add app.ts bun.lock package.json
$ git commit -m "Create simple Express app"

@@ -59,0 +59,0 @@ $ git push origin main

@@ -10,3 +10,3 @@ ---

- **Designed for Node.js & Bun**: `bun install` installs a Node.js compatible `node_modules` folder. You can use it in place of `npm install` for Node.js projects without any code changes and without using Bun's runtime.
- **Automatically converts `package-lock.json`** to bun's `bun.lockb` lockfile format, preserving your existing resolved dependency versions without any manual work on your part. You can secretly use `bun install` in place of `npm install` at work without anyone noticing.
- **Automatically converts `package-lock.json`** to bun's `bun.lock` lockfile format, preserving your existing resolved dependency versions without any manual work on your part. You can secretly use `bun install` in place of `npm install` at work without anyone noticing.
- **`.npmrc` compatible**: bun install reads npm registry configuration from npm's `.npmrc`, so you can use the same configuration for both npm and Bun.

@@ -13,0 +13,0 @@ - **Hardlinks**: On Windows and Linux, `bun install` uses hardlinks to conserve disk space and install times.

@@ -40,3 +40,3 @@ ---

$ rm -rf node_modules
$ rm bun.lockb
$ rm bun.lock
$ bun install

@@ -43,0 +43,0 @@ ```

---
name: Generate a human-readable lockfile
name: Generate a yarn-compatible lockfile
---

@@ -11,8 +11,4 @@

By default Bun generates a binary `bun.lockb` file when you run `bun install`. In some cases, it's preferable to generate a human-readable lockfile instead.
Use the `--yarn` flag to generate a Yarn-compatible `yarn.lock` file (in addition to `bun.lock`).
---
Use the `--yarn` flag to generate a Yarn-compatible `yarn.lock` file (in addition to `bun.lockb`).
```sh

@@ -33,3 +29,3 @@ $ bun install --yarn

To print a Yarn lockfile to your console without writing it to disk, just "run" your `bun.lockb` with `bun`.
To print a Yarn lockfile to your console without writing it to disk, "run" your `bun.lockb` with `bun`.

@@ -36,0 +32,0 @@ ```sh

@@ -44,3 +44,3 @@ The `bun` CLI contains an `npm`-compatible package manager designed to be a faster replacement for existing package management tools like `npm`, `yarn`, and `pnpm`. It's designed for Node.js compatibility; use it in any Bun or Node.js project.

- **Run** your project's `{pre|post}install` scripts at the appropriate time. For security reasons Bun _does not execute_ lifecycle scripts of installed dependencies.
- **Write** a `bun.lockb` lockfile to the project root.
- **Write** a `bun.lock` lockfile to the project root.

@@ -47,0 +47,0 @@ To install in production mode (i.e. without `devDependencies`):

@@ -1,52 +0,9 @@

Running `bun install` will create a binary lockfile called `bun.lockb`.
Running `bun install` will create a lockfile called `bun.lock`.
#### Why is it binary?
https://bun.sh/blog/bun-lock-text-lockfile
In a word: Performance. Bun’s lockfile saves & loads incredibly quickly, and saves a lot more data than what is typically inside lockfiles.
#### Should it be committed to git?
#### How do I inspect Bun's lockfile?
Yes
Run `bun install -y` to generate a Yarn-compatible `yarn.lock` (v1) that can be inspected more easily.
#### How do I `git diff` Bun's lockfile?
Add the following to your local or global `.gitattributes` file:
```
*.lockb binary diff=lockb
```
Then add the following to your local git config with:
```sh
$ git config diff.lockb.textconv bun
$ git config diff.lockb.binary true
```
Or to your global git config (system-wide) with the `--global` option:
```sh
$ git config --global diff.lockb.textconv bun
$ git config --global diff.lockb.binary true
```
**Why this works:**
- `textconv` tells git to run `bun` on the file before diffing
- `binary` tells git to treat the file as binary (so it doesn't try to diff it line-by-line)
Running `bun` on a lockfile will print a human-readable diff. So we just need to tell `git` to run `bun` on the lockfile before diffing it.
#### Platform-specific dependencies?
Bun stores normalized `cpu` and `os` values from npm in the lockfile, along with the resolved packages. It skips downloading, extracting, and installing packages disabled for the current target at runtime. This means the lockfile won’t change between platforms/architectures even if the packages ultimately installed do change.
#### What does Bun's lockfile store?
Packages, metadata for those packages, the hoisted install order, dependencies for each package, what packages those dependencies resolved to, an integrity hash (if available), what each package was resolved to, and which version (or equivalent).
#### Why is Bun's lockfile fast?
It uses linear arrays for all data. [Packages](https://github.com/oven-sh/bun/blob/be03fc273a487ac402f19ad897778d74b6d72963/src/install/install.zig#L1825) are referenced by an auto-incrementing integer ID or a hash of the package name. Strings longer than 8 characters are de-duplicated. Prior to saving on disk, the lockfile is garbage-collected & made deterministic by walking the package tree and cloning the packages in dependency order.
#### Generate a lockfile without installing?

@@ -72,3 +29,3 @@

To install a Yarn lockfile _in addition_ to `bun.lockb`.
To install a Yarn lockfile _in addition_ to `bun.lock`.

@@ -83,3 +40,3 @@ {% codetabs %}

[install.lockfile]
# whether to save a non-Bun lockfile alongside bun.lockb
# whether to save a non-Bun lockfile alongside bun.lock
# only "yarn" is supported

@@ -91,33 +48,6 @@ print = "yarn"

### Text-based lockfile
#### Text-based lockfile
Bun v1.1.39 introduced `bun.lock`, a JSONC formatted lockfile. `bun.lock` is human-readable and git-diffable without configuration, at [no cost to performance](https://bun.sh/blog/bun-lock-text-lockfile#cached-bun-install-gets-30-faster).
Bun v1.2 changed the default lockfile format to the text-based `bun.lock`. Existing binary `bun.lockb` lockfiles can be migrated to the new format by running `bun install --save-text-lockfile --frozen-lockfile --lockfile-only` and deleting `bun.lockb`.
To generate the lockfile, use `--save-text-lockfile` with `bun install`. You can do this for new projects and existing projects already using `bun.lockb` (resolutions will be preserved).
```bash
$ bun install --save-text-lockfile
$ head -n3 bun.lock
{
"lockfileVersion": 0,
"workspaces": {
```
Once `bun.lock` is generated, Bun will use it for all subsequent installs and updates through commands that read and modify the lockfile. If both lockfiles exist, `bun.lock` will be chosen over `bun.lockb`.
Bun v1.2.0 will switch the default lockfile format to `bun.lock`.
{% details summary="Configuring lockfile" %}
```toml
[install.lockfile]
# whether to save the lockfile to disk
save = true
# whether to save a non-Bun lockfile alongside bun.lockb
# only "yarn" is supported
print = "yarn"
```
{% /details %}
More information about the new lockfile format can be found on [our blogpost](https://bun.sh/blog/bun-lock-text-lockfile).

@@ -9,3 +9,3 @@ Bun supports [`workspaces`](https://docs.npmjs.com/cli/v9/using-npm/workspaces?v=true#description) in `package.json`. Workspaces make it easy to develop complex software as a _monorepo_ consisting of several independent packages.

├── README.md
├── bun.lockb
├── bun.lock
├── package.json

@@ -12,0 +12,0 @@ ├── tsconfig.json

@@ -17,3 +17,3 @@ If no `node_modules` directory is found in the working directory or higher, Bun will abandon Node.js-style module resolution in favor of the **Bun module resolution algorithm**.

1. Check for a `bun.lockb` file in the project root. If it exists, use the version specified in the lockfile.
1. Check for a `bun.lock` file in the project root. If it exists, use the version specified in the lockfile.
2. Otherwise, scan up the tree for a `package.json` that includes `"foo"` as a dependency. If found, use the specified semver version or version range.

@@ -20,0 +20,0 @@ 3. Otherwise, use `latest`.

@@ -243,9 +243,9 @@ Bun's behavior can be configured using its configuration file, `bunfig.toml`.

Generate `bun.lock`, a human-readable text-based lockfile. Once generated, Bun will use this file instead of `bun.lockb`, choosing it over the binary lockfile if both are present.
If false, generate a binary `bun.lockb` instead of a text-based `bun.lock` file when running `bun install` and no lockfile is present.
Default `false`. In Bun v1.2.0 the default lockfile format will change to `bun.lock`.
Default `true` (since Bun v1.2).
```toml
[install]
saveTextLockfile = true
saveTextLockfile = false
```

@@ -319,3 +319,3 @@

When true, `bun install` will not update `bun.lockb`. Default `false`. If `package.json` and the existing `bun.lockb` are not in agreement, this will error.
When true, `bun install` will not update `bun.lock`. Default `false`. If `package.json` and the existing `bun.lock` are not in agreement, this will error.

@@ -428,3 +428,3 @@ ```toml

Whether to generate a non-Bun lockfile alongside `bun.lockb`. (A `bun.lockb` will always be created.) Currently `"yarn"` is the only supported value.
Whether to generate a non-Bun lockfile alongside `bun.lock`. (A `bun.lock` will always be created.) Currently `"yarn"` is the only supported value.

@@ -431,0 +431,0 @@ ```toml

@@ -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/bun-v1.1.45" -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.2.0-canary.20250122T140708" -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/bun-v1.1.45
[fetch] > User-Agent: Bun/1.2.0-canary.20250122T140708
[fetch] > Accept: */*

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

[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/bun-v1.1.45
[fetch] > User-Agent: Bun/1.2.0-canary.20250122T140708
[fetch] > Accept: */*

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

@@ -261,3 +261,2 @@ Module resolution in JavaScript is a complex topic.

entryPoints: ["./app/foo/route.js"],
throw: true,
});

@@ -264,0 +263,0 @@ ```

@@ -21,2 +21,6 @@ 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.

### [`node:dgram`](https://nodejs.org/api/dgram.html)
🟢 Fully implemented. > 90% of Node.js's test suite passes.
### [`node:diagnostics_channel`](https://nodejs.org/api/diagnostics_channel.html)

@@ -34,2 +38,6 @@

### [`node:fs`](https://nodejs.org/api/fs.html)
🟢 Fully implemented. 92% of Node.js's test suite passes.
### [`node:http`](https://nodejs.org/api/http.html)

@@ -63,2 +71,6 @@

### [`node:stream`](https://nodejs.org/api/stream.html)
🟢 Fully implemented.
### [`node:string_decoder`](https://nodejs.org/api/string_decoder.html)

@@ -86,3 +98,3 @@

🟡 `AsyncLocalStorage`, and `AsyncResource` are implemented. `AsyncResource` is missing `bind`. v8 hooks are stubbed.
🟡 `AsyncLocalStorage`, and `AsyncResource` are implemented. v8 promise hooks are not called, and its usage is [strongly discouraged](https://nodejs.org/docs/latest/api/async_hooks.html#async-hooks).

@@ -99,11 +111,6 @@ ### [`node:child_process`](https://nodejs.org/api/child_process.html)

🟡 Missing `Certificate` `ECDH` `X509Certificate` `checkPrime` `checkPrimeSync` `diffieHellman` `generatePrime` `generatePrimeSync` `getCipherInfo` `getFips` `hkdf` `hkdfSync` `secureHeapUsed` `setEngine` `setFips`
🟡 Missing `ECDH` `checkPrime` `checkPrimeSync` `generatePrime` `generatePrimeSync` `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:domain`](https://nodejs.org/api/domain.html)

@@ -113,6 +120,2 @@

### [`node:fs`](https://nodejs.org/api/fs.html)
🟡 Missing `statfs` `statfsSync`, `opendirSync`. `Dir` is partially implemented.
### [`node:http2`](https://nodejs.org/api/http2.html)

@@ -138,6 +141,2 @@

### [`node:stream`](https://nodejs.org/api/stream.html)
🟡 Missing `toWeb`
### [`node:sys`](https://nodejs.org/api/util.html)

@@ -144,0 +143,0 @@

@@ -327,3 +327,2 @@ Bun provides a universal plugin API that can be used to extend both the _runtime_ and [_bundler_](https://bun.sh/docs/bundler).

],
throw: true,
});

@@ -355,3 +354,2 @@ ```

],
throw: true,
});

@@ -358,0 +356,0 @@ ```

@@ -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 vbun-v1.1.45
bun test v1.2.0-canary.20250122T140708

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

{
"version": "1.1.45",
"version": "1.2.0-canary.20250122T140708",
"name": "bun-types",

@@ -16,3 +16,3 @@ "license": "MIT",

"dependencies": {
"@types/node": "~20.12.8",
"@types/node": "*",
"@types/ws": "~8.5.10"

@@ -19,0 +19,0 @@ },

Sorry, the diff of this file is too big to display

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