| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Lecture examples for the Node.js Permission Model (Node 25+). The model is stable and enabled with --permission (not --experimental-permission).
| File | Purpose |
|---|---|
| config.json | Demo config (apiUrl, logFile). |
| app.js | Main demo app: reads config, writes log, HTTP get, worker, child process. |
| worker.js | Worker used by app.js. |
| 1-default.js / 1-default.sh | Run without permission mode. |
| 2-deny.sh | --permission only → fails (deny by default). |
| 3-fs-read.sh | Allow only config read. |
| 4-fs-write.sh | Config read + log write. |
| 5-net.sh | + network. |
| 6-worker.sh | + worker (and worker.js read). |
| 7-child.sh | + child process (full allow-list). |
| 8-runtime-check.js / 8-runtime-check.sh | process.permission.has() demo. |
From repo root (scripts cd into JavaScript/):
chmod +x JavaScript/*.sh
./JavaScript/1-default.sh # no restrictions
./JavaScript/2-deny.sh # fails with ERR_ACCESS_DENIED
./JavaScript/3-fs-read.sh # only config read
./JavaScript/4-fs-write.sh # + log write (ensure JavaScript/var exists)
./JavaScript/5-net.sh # + network
./JavaScript/6-worker.sh # + worker
./JavaScript/7-child.sh # full allow-list
./JavaScript/8-runtime-check.sh # runtime permission checksOr from JavaScript/:
node 1-default.js
node --permission app.js
# etc.Entrypoint script (e.g. app.js) is implicitly readable when permission mode is on.
| Back | FazBrowse Home | New Git URL |