import { chown } from "https://deno.land/x/ayonli_jsext@v0.9.72/fs.ts";
Changes the owner and group of the specified file or directory.
NOTE: This function is only available in Node.js, Deno and Bun, and only works in Unix/Linux systems, in other environments, it's a no-op.
Examples
Example 1
Example 1
import { chown } from "@ayonli/jsext/fs";
// Change the owner and group of the file to root.
await chown("/path/to/file.txt", 0, 0);