0.1.3 • Published 7 years ago

qm-fs-ifexists v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

logo-qm

qm-fs-ifexists npm version Build Status

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

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago