🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

fs-exists

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

fs-exists

Wraps fs.exists so callback is called with (err, result).

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
467
-24.19%
Maintainers
1
Weekly downloads
 
Created
Source

fs-exists Build Status

Wraps Node.js' native fs.exists so callback is called with (err, result) instead of just (result).
Since it's just wrapping fs.exists, the err argument will always be null.

I developed the module to have a function that can be easily adapted to return a promise (for example with faithful.adapt from my Faithful project), but you may find other uses for it.

Usage

fsExists = require('fs-exists')
fsExists(path, function(err, result) {
  if (err) throw err; // err will always be null
  if(result)
    console.log "the entry exists"
  else
    console.log "the entry does not exist"
})

License

fs-exists is released under the MIT License.
Copyright (c) 2013 Meryn Stol

FAQs

Package last updated on 10 May 2013

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