From 41fad84035daa37baf07a888322b2f17dd1d563c Mon Sep 17 00:00:00 2001 From: Juan Roa Date: Fri, 21 Jun 2019 16:56:56 -0500 Subject: [PATCH] doc: add example for chmod in fs.md PR-URL: https://github.com/nodejs/node/pull/28365 Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen --- doc/api/fs.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index a637a22edc5b4a..3834131d8d28f9 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -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()`