Home > @rushstack/node-core-library > FileSystem > readLink

If path refers to a symbolic link, this returns the path of the link target, which may be an absolute or relative path.

Signature:

static readLink(path: string): string;

Parameters

Parameter Type Description
path string The absolute or relative path to the symbolic link.

Returns:

string

the path of the link target

Remarks

If path refers to a filesystem object that is not a symbolic link, then an ErrnoException is thrown with code ‘UNKNOWN’. If path does not exist, then an ErrnoException is thrown with code ENOENT.