Skip to content
Open
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
21 changes: 19 additions & 2 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -3140,10 +3140,14 @@

<!-- YAML
added: v20.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/65492

Check warning on line 3145 in doc/api/process.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
description: The `reference` argument can be a `URL` or a `Uint8Array`.
-->

* `scope` {string}
* `reference` {string}
* `reference` {string|URL|Uint8Array}
* Returns: {boolean}

Verifies that the process is able to access the given scope and reference.
Expand All @@ -3157,6 +3161,10 @@
The reference has a meaning based on the provided scope. For example,
the reference when the scope is File System means files and folders.

For File System scopes, a `URL` reference must use the `file:` protocol and is
converted to a path, while a `Uint8Array` reference is treated as the raw bytes
of a path. Other scopes ignore the reference.

The available scopes are:

* `fs` - All File System
Expand All @@ -3166,6 +3174,10 @@
* `env` - Environment variables
* `openssl.store` - Loading keys through OpenSSL STORE loaders
* `worker` - Worker thread spawning operation
* `net` - Network operations
* `inspector` - Inspector operations
* `wasi` - WASI operations
* `addon` - Native addon operations
* `ffi` - Foreign function interface operations

```js
Expand All @@ -3181,12 +3193,16 @@
added:
- v26.3.0
- v24.20.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/65492

Check warning on line 3198 in doc/api/process.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
description: The `reference` argument can be a `URL` or a `Uint8Array`.
-->

> Stability: 1.1 - Active Development

* `scope` {string}
* `reference` {string}
* `reference` {string|URL|Uint8Array}

Drops the specified permission from the current process. This operation is
**irreversible** — once a permission is dropped, it cannot be restored through
Expand Down Expand Up @@ -3229,6 +3245,7 @@
* `inspector` - Inspector operations
* `wasi` - WASI operations
* `addon` - Native addon operations
* `ffi` - Foreign function interface operations

```js
const fs = require('node:fs');
Expand Down
Loading