New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bun-types

Package Overview
Dependencies
Maintainers
3
Versions
842
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

to
1.1.45-canary.20250121T140608

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/1.1.45-canary.20250120T140547
[fetch] > User-Agent: Bun/1.1.45-canary.20250121T140608
[fetch] > Accept: */*

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

@@ -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.45-canary.20250120T140547"
console.log(text); // => "1.1.45-canary.20250121T140608"
```

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

@@ -201,2 +201,50 @@ 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.

## 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

@@ -248,2 +296,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.

@@ -1425,4 +1425,5 @@ 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.

<!-- 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

@@ -1486,68 +1487,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

@@ -1554,0 +1491,0 @@

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

## Output
bun publish v1.1.45-canary.20250120T140547 (ca7428e9)
bun publish v1.1.45-canary.20250121T140608 (ca7428e9)

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

@@ -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.45-canary.20250120T140547" -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.45-canary.20250121T140608" -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.45-canary.20250120T140547
[fetch] > User-Agent: Bun/1.1.45-canary.20250121T140608
[fetch] > Accept: */*

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

[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.1.45-canary.20250120T140547
[fetch] > User-Agent: Bun/1.1.45-canary.20250121T140608
[fetch] > Accept: */*

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

@@ -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)

@@ -104,7 +108,2 @@

### [`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)

@@ -111,0 +110,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 v1.1.45-canary.20250120T140547
bun test v1.1.45-canary.20250121T140608

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

{
"version": "1.1.45-canary.20250120T140547",
"version": "1.1.45-canary.20250121T140608",
"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