Skip to content

Commit

Permalink
doc: add example for chmod in fs.md
Browse files Browse the repository at this point in the history
PR-URL: #28365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
roadev authored and addaleax committed Jul 3, 2019
1 parent c03df4c commit 41fad84
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,13 @@ possible exception are given to the completion callback.

See also: chmod(2).

```js
fs.chmod('my_file.txt', 0o775, (err) => {
if (err) throw err;
console.log('The permissions for file "my_file.txt" have been changed!');
});
```

### File modes

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

0 comments on commit 41fad84

Please sign in to comment.