From e83b2563061f75ae1351c12cdc58029cb93cb708 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 772d1dc8e4f9af..62c07160f1b356 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -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()`