Check if a filepath point to a symbolic link. Returns false if the filepath is a regular file or directory, or if it does not exist.

await isSymlink(filepath)

Examples

if (await isSymlink('./bin/command')) {
  console.info('The command is a symbolic link');
}

Note

By design, this method will return true for broken symlinks (where the destination does not exist).