Skip to content

Commit

Permalink
doc: add section about using npx with permission model
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS committed Jan 9, 2025
1 parent 98d4ebc commit 93ea0ab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/api/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,21 @@ does not exist, the wildcard will not be added, and access will be limited to
yet, make sure to explicitly include the wildcard:
`/my-path/folder-do-not-exist/*`.

#### Enabling Permission Model with npx

If you're using `npx` to execute a Node.js script, you can enable the Permission
Model by using the `--node-options` flag.

```bash
npx --node-options="--permission --allow-fs-read=./" your-script
```

This argument will set the `NODE_OPTIONS` environment variable to all
Node.js processes spawned by `npx` (without affecting `npx` itself!).

Any arguments you would normally pass directly to `node`
(such as `--allow-*` flags) can also be passed through `--node-options`.

#### Permission Model constraints

There are constraints you need to know before using this system:
Expand Down

0 comments on commit 93ea0ab

Please sign in to comment.