doc: add example for chmod in fs.md

PR-URL: https://github.com/nodejs/node/pull/28365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Juan Roa 2019-06-21 16:56:56 -05:00 committed by Anna Henningsen
parent c03df4c75d
commit 41fad84035
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -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()`