Function chmod

  • 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!');
    });

    Parameters

    Returns void

    Since

    v0.1.30

    See

  • 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!');
    });

    Parameters

    Returns Promise<void>

    Since

    v0.1.30

    See

Methods

  • Asynchronous chmod(2) - Change permissions of a file.

    Parameters

    • path: PathLike

      A path to a file. If a URL is provided, it must use the file: protocol.

    • mode: Mode

      A file mode. If a string is passed, it is parsed as an octal integer.

    Returns Promise<void>

Generated using TypeDoc