Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

file-exists-promise

tanhauhau14kMIT1.0.2

fs.exists with ES6 Promise that is not deprecated

fs, file, exists, promise, es6-promise, async

readme

file-exists-promise

Build Status npm version Dependency status Downloads Donate

fs.exists with ES6 Promise that is not deprecated

This is the implementation using fs.statsSync to check whether the file exists instead of the deprecated fs.existsSync.

Installation

$ npm install --save file-exists-promise

Usage

var fileExists = require('file-exists-promise'),
      path = require('path');

      fileExists(path.resolve(__dirname, './file.txt'))
      .then(function(stat){
          console.log('yeah it exists!');
          console.log('and the stat of the file --> ' + stat);
      })
      .catch(function(){
          console.log('oh no... it does not exist');
      });

License

MIT