import { link } from "https://deno.land/x/ayonli_jsext@v0.9.72/fs.ts";
Creates a hard link (or symbolic link) from the source path to the destination path.
NOTE: This function is only available in Node.js, Deno and Bun.
Examples
Example 1
Example 1
// create a hard link
import { link } from "@ayonli/jsext/fs";
await link("/path/to/file.txt", "/path/to/link.txt");
Example 2
Example 2
// create a symbolic link
import { link } from "@ayonli/jsext/fs";
await link("/path/to/file.txt", "/path/to/link.txt", { symbolic: true });