5.0.1 • Published 8 years ago

file-exists v5.0.1

Weekly downloads
61,618
License
MIT
Repository
github
Last release
8 years ago

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
})

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
simpleembedmangareader-dlredux-saga-crud-generatorredux-saga-generatorredux-saga-crud-cliinterractjsontzar-coregulp-task-runnerwebpack-clicknownode-commentsget-seleniumzikkurat@infinitebrahmanuniverse/nolb-file-@everything-registry/sub-chunk-1665exchange-trackerether-trackertdztabeltachyons-clitapc-plugin-buildtapc-plugin-watchtaqzswig-stylebundler-loadert3js-cliwinrarjsvulpeswdc-tailweb-dev-gulpwebacwflowwheelhouse-packagertelegram-emoji-spritesstarrynightswapittfk-arkiv-metadatageneratortfk-template-to-pdftfk-template-to-pdf-nodetetco-helpervitomuciventrilo-homebridge-script2vc-elixir-typescriptvelsonvoicer@dreamistlabs/dlabs-cli@caktus/gulp-tasks@weprovide/swdevjfqis-ali-intranetjscryptor-clileafpoda-nwjacks-angular4-clijacks-polymer3-clikikdkewarrjsonsavefilekeystone-imageslaravel-elixir-webpack-modernizr-loaderimmutable-cssimmutable-css-cliimageoverlayinject-text-webpack-pluginhomebridge-door-openergulp-auto-importsgulp-css-processorgulp-css-rebasegulp-process-file-loggulp-render-jsongulp-file-loadergulp-api-doc-copygulp-config-transformgulp-from-configgulp-from-config-rghomebridge-home-door-openerhomebridge-script2-denkohomebridge-script2-ventrilohomebridge-script3homebridge-script-hubhomebridge-script-maiohomebridge-script2html-pageshpm-clihighoutput-email-servicegulp-workerhandler-fileshb-full-cligulp-spritergulp-spriter-nygulp-spriter-xygulp-true-rebasegulp-twig-phpinterop-clientinteractive-envlionsoft-common-toolslinter-gitignorelinkmonmagedevmarblejslufi-cli@wikiviews/wikiviews-importer@wtg/scripts
5.0.1

8 years ago

5.0.0

8 years ago

4.0.0

8 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.0.0

10 years ago

0.1.1

11 years ago

0.1.0

11 years ago