2.0.0 • Published 8 years ago
is-symlink-sync v2.0.0
is-symlink-sync
Synchronously check if a file is a symbolic link
const isSymlinkSync = require('is-symlink-sync');
isSymlinkSync('path/to/symlink'); //=> true
isSymlinkSync('path/to/non-symlink'); //=> falseInstallation
npm install is-symlink-syncAPI
const isSymlinkSync = require('is-symlink-sync');isSymlinkSync(filePath)
filePath: string, Buffer or URL
Return: boolean
It returns true if the file exists and is a symbolic link, otherwise false.
Only when the argument type is invalid, it throws an error.
isSymlinkSync(Buffer.from('123')); // doesn't throw any errors
isSymlinkSync(123); // throws a TypeErrorLicense
Copyright (c) 2015 - 2017 Shinnosuke Watanabe
Licensed under the MIT License.