Node fs.chmod function | API Reference | Bun
BuildDocsReferenceGuidesBlogDiscord/
node:fs/
chmodNchmod
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
node:fs/
chmodNchmod
namespace
fs.chmod {
if (err) throw err;
console.log('The permissions for file "my_file.txt" have been changed!');
});
```" data-algolia-static="false" data-algolia-merged="true" data-type="Namespace">function
chmod(path:
PathLike,mode:
Mode,callback:
NoParamCallback): void;
Asynchronously changes the permissions of a file. No arguments other than a possible exception are given to the completion callback.
See the POSIX chmod(2) documentation for more detail.
import { chmod } from 'node:fs';
chmod('my_file.txt', 0o775, (err) => {
if (err) throw err;
console.log('The permissions for file "my_file.txt" have been changed!');
});
namespace
chmodResources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →