qm-fs-ifexists
v0.1.3
Published
Check if exists file or dir
Downloads
3
Readme
qm-fs-ifexists
Checks if file or dir exists. Use only in node.js above v.8 because of
util.promisify
usage.
Installation
$ npm i -S qm-fs-ifexists
Usage
import { ifExists } from 'qm-fs-ifexists';
// default
const options = {
asBoolean = true,
synchronous = false
};
ifExists('./someFile', options).then(result => {
console.log(result); // true or false
});
// or
ifExists('./someFile', { asBoolean: false }).then(result => {
console.log(result); // 'file' / 'dir' / 'other'
});
Result
Returs promise or boolean/string value for synchronous usage.
License
MIT © qaraluch