symlinkSync

import { symlinkSync } from "jsr:@ende/fs/unstable-symlink";

function · experimental · requires --allow-read, --allow-write

function symlinkSync(oldpath: string | URL, newpath: string | URL, options?: SymlinkOptions): void

Creates newpath as a symbolic link to oldpath.

The options.type parameter can be set to "file", "dir" or "junction". This argument is only available on Windows and ignored on other platforms.

Requires full allow-read and allow-write permissions.

oldpath: string | URL

The path of the resource pointed by the symbolic link.

newpath: string | URL

The path of the symbolic link.

options?: SymlinkOptions

Options when creating a symbolic link.

Example: Usage

import { symlinkSync } from "@ende/fs/unstable-symlink";
symlinkSync("README.md", "README.md.link");

Source