Skip to content

Commit 41fad84

Browse files
roadevaddaleax
authored andcommitted
doc: add example for chmod in fs.md
PR-URL: #28365 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent c03df4c commit 41fad84

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/api/fs.md

+7
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,13 @@ possible exception are given to the completion callback.
12431243

12441244
See also: chmod(2).
12451245

1246+
```js
1247+
fs.chmod('my_file.txt', 0o775, (err) => {
1248+
if (err) throw err;
1249+
console.log('The permissions for file "my_file.txt" have been changed!');
1250+
});
1251+
```
1252+
12461253
### File modes
12471254

12481255
The `mode` argument used in both the `fs.chmod()` and `fs.chmodSync()`

0 commit comments

Comments
 (0)