Skip to content

Commit

Permalink
streamline exists callback
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Jul 29, 2015
1 parent a2e3f41 commit 078a22a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,13 @@ helpers.discernFileFormatter = function (fileName) {
*
* @example
* var exists = io.exists('path/to/data.tsv', function (err, exists) {
* console.log(err) // `false` if the file exists, `true` if not.
* console.log(exists) // `true` if the file exists, `false` if not.
* })
*
*/
helpers.exists = function (filename, cb) {
fs.access(function (err) {
var exists = err ? false : true
cb(!exists, exists)
cb(err, err !== null)
})
}

Expand Down

0 comments on commit 078a22a

Please sign in to comment.