is-symlink-sync

Synchronously check if a file is a symbolic link

MIT 8 个版本
安装
npm install is-symlink-sync
yarn add is-symlink-sync
pnpm add is-symlink-sync
bun add is-symlink-sync
README

is-symlink-sync

npm version Build Status Build status Coverage Status

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'); //=> false

Installation

Use npm.

npm install is-symlink-sync

API

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 TypeError

License

Copyright (c) 2015 - 2017 Shinnosuke Watanabe

Licensed under the MIT License.

版本列表
2.0.0-2 2017-09-04
2.0.0-1 2017-09-01
2.0.0-0 2017-08-30
2.0.0 2017-09-05
1.0.2 2015-10-20
1.0.1 2015-06-02
1.0.0 2015-02-17
0.0.0 2015-02-17