@@ -123,7 +123,7 @@ require('nodejs-addon-example');
123
123
```
124
124
125
125
``` console
126
- $ node --experimental- permission --allow-fs-read=* index.js
126
+ $ node --permission --allow-fs-read=* index.js
127
127
node:internal/modules/cjs/loader:1319
128
128
return process.dlopen(module, path.toNamespacedPath(filename));
129
129
^
@@ -165,7 +165,7 @@ childProcess.spawn('node', ['-e', 'require("fs").writeFileSync("/new-file", "exa
165
165
```
166
166
167
167
``` console
168
- $ node --experimental- permission --allow-fs-read=* index.js
168
+ $ node --permission --allow-fs-read=* index.js
169
169
node:internal/child_process:388
170
170
const err = this._handle.spawn(options);
171
171
^
@@ -189,12 +189,15 @@ Error: Access to this API has been restricted
189
189
<!-- YAML
190
190
added: v20.0.0
191
191
changes:
192
+ - version: REPLACEME
193
+ pr-url: https://github.com./nodejs/node/pull/56201
194
+ description: Permission Model and --allow-fs flags are stable.
192
195
- version: v20.7.0
193
196
pr-url: https://github.com./nodejs/node/pull/49047
194
197
description: Paths delimited by comma (`,`) are no longer allowed.
195
198
-->
196
199
197
- > Stability: 1.1 - Active development
200
+ > Stability: 2 - Stable.
198
201
199
202
This flag configures file system read permissions using
200
203
the [ Permission Model] [ ] .
@@ -210,7 +213,7 @@ Examples can be found in the [File System Permissions][] documentation.
210
213
The initializer module also needs to be allowed. Consider the following example:
211
214
212
215
``` console
213
- $ node --experimental- permission index.js
216
+ $ node --permission index.js
214
217
215
218
Error: Access to this API has been restricted
216
219
at node:internal/main/run_main_module:23:47 {
@@ -223,20 +226,23 @@ Error: Access to this API has been restricted
223
226
The process needs to have access to the ` index.js ` module:
224
227
225
228
``` bash
226
- node --experimental- permission --allow-fs-read=/path/to/index.js index.js
229
+ node --permission --allow-fs-read=/path/to/index.js index.js
227
230
```
228
231
229
232
### ` --allow-fs-write `
230
233
231
234
<!-- YAML
232
235
added: v20.0.0
233
236
changes:
237
+ - version: REPLACEME
238
+ pr-url: https://github.com./nodejs/node/pull/56201
239
+ description: Permission Model and --allow-fs flags are stable.
234
240
- version: v20.7.0
235
241
pr-url: https://github.com./nodejs/node/pull/49047
236
242
description: Paths delimited by comma (`,`) are no longer allowed.
237
243
-->
238
244
239
- > Stability: 1.1 - Active development
245
+ > Stability: 2 - Stable.
240
246
241
247
This flag configures file system write permissions using
242
248
the [ Permission Model] [ ] .
@@ -282,7 +288,7 @@ new WASI({
282
288
```
283
289
284
290
``` console
285
- $ node --experimental- permission --allow-fs-read=* index.js
291
+ $ node --permission --allow-fs-read=* index.js
286
292
287
293
Error: Access to this API has been restricted
288
294
at node:internal/main/run_main_module:30:49 {
@@ -313,7 +319,7 @@ new Worker(__filename);
313
319
```
314
320
315
321
``` console
316
- $ node --experimental- permission --allow-fs-read=* index.js
322
+ $ node --permission --allow-fs-read=* index.js
317
323
318
324
Error: Access to this API has been restricted
319
325
at node:internal/main/run_main_module:17:47 {
@@ -949,24 +955,6 @@ added:
949
955
950
956
Enable experimental support for the network inspection with Chrome DevTools.
951
957
952
- ### ` --experimental-permission `
953
-
954
- <!-- YAML
955
- added: v20.0.0
956
- -->
957
-
958
- > Stability: 1.1 - Active development
959
-
960
- Enable the Permission Model for current process. When enabled, the
961
- following permissions are restricted:
962
-
963
- * File System - manageable through
964
- [ ` --allow-fs-read ` ] [ ] , [ ` --allow-fs-write ` ] [ ] flags
965
- * Child Process - manageable through [ ` --allow-child-process ` ] [ ] flag
966
- * Worker Threads - manageable through [ ` --allow-worker ` ] [ ] flag
967
- * WASI - manageable through [ ` --allow-wasi ` ] [ ] flag
968
- * Addons - manageable through [ ` --allow-addons ` ] [ ] flag
969
-
970
958
### ` --experimental-print-required-tla `
971
959
972
960
<!-- YAML
@@ -1780,6 +1768,28 @@ unless either the `--pending-deprecation` command-line flag, or the
1780
1768
are used to provide a kind of selective "early warning" mechanism that
1781
1769
developers may leverage to detect deprecated API usage.
1782
1770
1771
+ ### ` --permission `
1772
+
1773
+ <!-- YAML
1774
+ added: v20.0.0
1775
+ changes:
1776
+ - version: REPLACEME
1777
+ pr-url: https://github.com./nodejs/node/pull/56201
1778
+ description: Permission Model is now stable.
1779
+ -->
1780
+
1781
+ > Stability: 2 - Stable.
1782
+
1783
+ Enable the Permission Model for current process. When enabled, the
1784
+ following permissions are restricted:
1785
+
1786
+ * File System - manageable through
1787
+ [ ` --allow-fs-read ` ] [ ] , [ ` --allow-fs-write ` ] [ ] flags
1788
+ * Child Process - manageable through [ ` --allow-child-process ` ] [ ] flag
1789
+ * Worker Threads - manageable through [ ` --allow-worker ` ] [ ] flag
1790
+ * WASI - manageable through [ ` --allow-wasi ` ] [ ] flag
1791
+ * Addons - manageable through [ ` --allow-addons ` ] [ ] flag
1792
+
1783
1793
### ` --preserve-symlinks `
1784
1794
1785
1795
<!-- YAML
@@ -3089,6 +3099,7 @@ one is included in the list below.
3089
3099
* ` --openssl-legacy-provider `
3090
3100
* ` --openssl-shared-config `
3091
3101
* ` --pending-deprecation `
3102
+ * ` --permission `
3092
3103
* ` --preserve-symlinks-main `
3093
3104
* ` --preserve-symlinks `
3094
3105
* ` --prof-process `
0 commit comments