Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7925,6 +7925,20 @@ Objects returned from [`fs.statfs()`][] and its synchronous counterpart are of
this type. If `bigint` in the `options` passed to those methods is `true`, the
numeric values will be `bigint` instead of `number`.

The block counts are expressed in units of `statfs.bsize`, which is reported in
bytes. For example, to calculate available space:

```mjs
import { statfs } from 'node:fs/promises';

const stats = await statfs('/tmp');
const availableBytes = stats.bavail * stats.bsize;
const totalBytes = stats.blocks * stats.bsize;
const availableFiles = stats.ffree;

console.log({ availableBytes, totalBytes, availableFiles });
```

```console
StatFs {
type: 1397114950,
Expand Down Expand Up @@ -7963,7 +7977,7 @@ added:

* Type: {number|bigint}

Free blocks available to unprivileged users.
Free blocks available to unprivileged users, in units of `statfs.bsize`.

#### `statfs.bfree`

Expand All @@ -7975,7 +7989,7 @@ added:

* Type: {number|bigint}

Free blocks in file system.
Free blocks in the file system, in units of `statfs.bsize`.

#### `statfs.blocks`

Expand All @@ -7987,7 +8001,7 @@ added:

* Type: {number|bigint}

Total data blocks in file system.
Total data blocks in the file system, in units of `statfs.bsize`.

#### `statfs.bsize`

Expand All @@ -7999,7 +8013,7 @@ added:

* Type: {number|bigint}

Optimal transfer block size.
Optimal transfer block size, in bytes.

#### `statfs.frsize`

Expand All @@ -8009,7 +8023,7 @@ added: v26.1.0

* Type: {number|bigint}

Fundamental file system block size.
Fundamental file system block size, in bytes.

#### `statfs.ffree`

Expand Down Expand Up @@ -8045,7 +8059,7 @@ added:

* Type: {number|bigint}

Type of file system.
Operating system-specific numeric file system type.

### Class: `fs.Utf8Stream`

Expand Down
13 changes: 13 additions & 0 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,19 @@ The implementation is based upon [undici](https://undici.nodejs.org), an HTTP/1.
written from scratch for Node.js. You can figure out which version of `undici` is bundled
in your Node.js process reading the `process.versions.undici` property.

### Node.js-specific behavior

The Node.js implementation is intentionally close to the browser standard, but
it runs outside a browser context and includes some Node.js-specific behavior:

* Cookie storage is not provided by Node.js. To preserve cookies across
requests, manage `Cookie` and `Set-Cookie` headers manually or use a separate
cookie store.
* Header handling is not constrained by the browser forbidden request-header
rules.
* Request and response bodies can be backed by Node.js streams and other
async iterable sources supported by undici.

### Custom dispatcher

You can use a custom dispatcher to dispatch requests passing it in fetch's options object.
Expand Down
6 changes: 6 additions & 0 deletions doc/api/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,12 @@ least specific in object order_.

Using the `"import"` and `"require"` conditions can lead to some hazards,
which are further explained in [the dual CommonJS/ES module packages section][].
If a package wants to avoid the dual package hazard in Node.js while still
providing an ES module build for non-Node.js environments, consider using
`"node"` and `"default"` conditions instead. For example, the `"node"`
condition can point to a single CommonJS implementation for Node.js, while the
`"default"` condition points to an ES module implementation for browsers or
other JavaScript runtimes.
Comment on lines +723 to +728
Copy link
Copy Markdown
Member

@GeoffreyBooth GeoffreyBooth May 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this being added? This should be its own PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, this PR should be split in 3


The `"node-addons"` condition can be used to provide an entry point which
uses native C++ addons. However, this condition can be disabled via the
Expand Down
Loading