nano-exists

0.1.1 • Public • Published

nano-exists

npm version Dependencies Status devDependencies Status build status

An async/await wrapper to check if something in the filesystem exists.

Getting Started

This is how we roll:

Installing

$ npm i nano-exists

Usage

const exists = require('nano-exists')('fs');

(async () => {
  try{
    await console.log(await exists.check(process.argv[2]));
  } catch (err) {
    return console.log(err);
  }
})();

Instead of fs you could use any other filesystem module which has the method fs.accesSync(), such as fs-extra. Just replace

const exists = require('nano-exists')('fs');

with

const exists = require('nano-exists')('fs-extra');

API

check(path)

Returns a boolean in an async matter wether path exists or not.

If path exists returns true else returns false.

Tests

$ npm run test

Built With

Package Sidebar

Install

npm i nano-exists

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

3.64 kB

Total Files

4

Last publish

Collaborators

  • vardrop