GitHub - coderaiser/superstat: Smooth out differences between stat and lstat · GitHub
Skip to content

coderaiser/superstat

Folders and files

Repository files navigation

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

About

Smooth out differences between stat and lstat

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors