🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

file-exists-promise

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-exists-promise

fs.exists with ES6 Promise that is not deprecated

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
4.4K
3.83%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

fs

FAQs

Package last updated on 24 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts