Skip to content

Commit e83b256

Browse files
roadevtargos
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 c177a68 commit e83b256

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/api/fs.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,13 @@ possible exception are given to the completion callback.
11811181

11821182
See also: chmod(2).
11831183

1184+
```js
1185+
fs.chmod('my_file.txt', 0o775, (err) => {
1186+
if (err) throw err;
1187+
console.log('The permissions for file "my_file.txt" have been changed!');
1188+
});
1189+
```
1190+
11841191
### File modes
11851192

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

0 commit comments

Comments
 (0)