diff --git a/doc/api/fs.md b/doc/api/fs.md index 00db67b7830861..72695205d6ccf1 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', 775, (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()` @@ -1293,13 +1300,6 @@ Caveats: on Windows only the write permission can be changed, and the distinction among the permissions of group, owner or others is not implemented. -```js -fs.chmod('my_file.txt', 775, (err) => { - if (err) throw err; - console.log('The permissions for file "my_file.txt" have been changed!'); -}); -``` - ## fs.chmodSync(path, mode)