superstat

smooth out differences between stat and lstat

MIT 5 个版本
安装
npm install superstat
yarn add superstat
pnpm add superstat
bun add superstat
README

Superstat License NPM version Dependency Status Build Status Coverage Status

Smooth out differences between stat and lstat.

Why?

  • Symbolic link stat returned by lstat.isDirectory() is always false.
  • To know if a link is a directory we should call stat.isDirectory().
  • stat.isSymbolicLink() is always false.

Install

npm i superstat

Example

Create symlink to root directory:

ln -s / hello
const stat = await superstat('./hello');

stat.isDirectory()
// returns
true

stat.isSymbolicLink()
// returns
true

License

MIT

版本列表
2.0.3 2020-04-26
2.0.2 2020-04-14
2.0.1 2020-04-14
2.0.0 2020-04-14
1.0.0 2019-04-25