file-exists-dazinatorfork
Check if filepath exists and is a file. Note this is a fork of file-exists dpenedency with some ammendments.
Last updated 8 years ago by dazinator .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install file-exists-dazinatorfork 
SYNC missed versions from official npm registry.

file-exists

Check if filepath exists and is a file. Returns false for directories.

(Requires node >=6.0.0)

Install

npm install file-exists --save

Usage

const fileExists = require('file-exists');

fileExists('/index.html', (err, exists) => console.log(exists)) // OUTPUTS: true or false

fileExists('/index.html').then(exists => {
  console.log(exists) // OUTPUTS: true or false
})

const exists = await fileExists('/index.html')

console.log(fileExists.sync('/index.html')) // OUTPUTS: true or false

Options

fileExists(filepath[, options, callback])

  • filepath - the path to the file to check if it exists
  • options - an object of options
    • root - the root directory to look in (or cwd)
  • callback(err, exists) - gets called when checking is done

fileExists.sync(filepath[, options])

  • filepath - the path to the file to check if it exists
  • options - an object of options
    • root - the root directory to look in (or cwd)

Run Tests

npm install
npm test

Current Tags

  • 1.0.2                                ...           latest (8 years ago)

1 Versions

  • 1.0.2                                ...           8 years ago
Maintainers (1)
Downloads
Total 4
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 3
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE