valid-file
v0.0.2
Published
Check if a file is a file.
Downloads
10
Maintainers
Readme
valid-file
Check if a file is a file.
Returns true
if the path points to a valid file, otherwise, return false
.
Install
$ npm install --save valid-file
Usage
const validFile = require('valid-file');
Async
validFile('path/to/valid/file.txt', valid => {
console.log(valid);
});
//=> true
Sync
validFile.sync('path/to/valid/file.txt');
//=> true
API
validFile(path, cb)
path
Type: string
The path to the file you are verifying.
cb
Type: function
Returns a single boolean indicating if the file is valid.
validFile.sync(path)
Returns: Boolean
The synchronous version of validFile()
. No callback is supplied.
License
MIT © Michael Wuergler