|
|
il y a 3 ans | |
|---|---|---|
| .. | ||
| out | il y a 3 ans | |
| README.md | il y a 3 ans | |
| package.json | il y a 3 ans | |
Get the status of a file with some features.
Wrapper over standard methods (fs.lstat, fs.stat) with some features.
$ npm install @nodelib/fs.stat
const fsStat = require('@nodelib/fs.stat');
fsStat.stat('path').then((stat) => {
console.log(stat); // => fs.Stats
});
Returns a Promise<fs.Stats> for provided path.
Returns a fs.Stats for provided path.
Returns a fs.Stats for provided path with standard callback-style.
string | Buffer | URLThe path argument for fs.lstat or fs.stat method.
ObjectSee options section for more detailed information.
booleantrueThrow an error or return information about symlink, when symlink is broken. When false, methods will be return lstat call for broken symlinks.
booleantrueBy default, the methods of this package follows symlinks. If you do not want it, set this option to false or use the standard method fs.lstat.
FileSystemAdapterbuilt-in FS methodsBy default, the built-in Node.js module (fs) is used to work with the file system. You can replace each method with your own.
interface FileSystemAdapter {
lstat?: typeof fs.lstat;
stat?: typeof fs.stat;
lstatSync?: typeof fs.lstatSync;
statSync?: typeof fs.statSync;
}
See the Releases section of our GitHub project for changelogs for each release version.
This software is released under the terms of the MIT license.