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 targos committed Jul 20, 2019
1 parent c177a68 commit e83b256
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 @@ -1181,6 +1181,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 e83b256

Please sign in to comment.