Chmod
[<Interface>]
type Chmod =
abstract member Invoke (path: PathLike, mode: Mode, callback: NoParamCallback) : unit
abstract member __promisify__ (path: PathLike, mode: Mode) : Promise<unit>| Assembly | Xantham.Fable.Node |
Methods
abstract member Invoke (path: PathLike, mode: Mode, callback: NoParamCallback) : unit
abstract member Invoke (path: PathLike, mode: Mode, callback: NoParamCallback) : unitAsynchronously 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!');
});
@since v0.1.30