5.0.0 • Published 1 year ago

path-exists v5.0.0

Weekly downloads
45,002,989
License
MIT
Repository
github
Last release
1 year ago

path-exists

Check if a path exists

NOTE: fs.existsSync has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed.

Never use this before handling a file though:

In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to fs.exists() and fs.open(). Just open the file and handle the error when it's not there.

Install

$ npm install path-exists

Usage

// foo.js
import {pathExists} from 'path-exists';

console.log(await pathExists('foo.js'));
//=> true

API

pathExists(path)

Returns a Promise<boolean> of whether the path exists.

pathExistsSync(path)

Returns a boolean of whether the path exists.

Related


find-upfind-babel-config@lerna/rimraf-dirchinjowwchinjowvuedragdropuploadimages@cyber-tools/cyber-order@cyber-tools/lib-clipopsmart-common-authreact-native-bluetooth2killi8n-react-native-fast-imagepipihomern-send-smsspecify-importsbabel-specify-imports@icanpm/api-masterharden-cli@arisageha/react-lazyload@arisageha/react-lazyload-fixfoshata-markdown@cashremit/cr-streamline-icons@omake/react-scripts@almeidaa/ms@ultradent/nano-site-generator@cyber-tools/ns-gitreact-native-template-rfbasesalesforce-create-faux-classesqoros-gitmoji-cli@stelladoradus/stella-cliairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-moduletzar-core@frxf/frxfkubii-api@willes-cli-dev/bootdeneme323112@ecej-cli/core@texttree/demo-bsa-reference-rcl@fundefund/funde_ck@ntt_app/react-native-custom-notificationwenke-babel-corereact-native-custom-text-hwjames@sonammalhotra/lotide@form-cli-dev/package@form-cli-dev/core@smishra17/lotide@cheapthrills/lotide@form-cli-dev/packaget@form-cli-dev/coretreact-native-covid-sdk@lego-cli/coregql_din_mod@zxy-cli/cliinotifywait-pathbitgetzetan-test-testalex-frontend-sdk-stagingafryxiconsreact-native-thanh-toast-librarymutasi-bcamyth-clisalut_gongjang_first_moduledevchain@jttechnic/interpreter@samuel-template-cli/core@samuel-template-cli/package@thanhnguyen14797/react-native-thanh-toast-library@suanlafen/core@rp-cli/coresparrow-bird-server@l1nyanm1ng/react-picture-viewer@upp-cli/core@upp-cli/package@dx-cli-dev/core@blink-cli-dev/core@blink-cli-dev/package@czq-cli/core@czq-cli/package@weilai-cli/core@weilai-cli/package@weex-cli/core@wfw-cli/core@wfw-cli/package@wf-imooc-cli-dev/core@wf-imooc-cli-dev/package@webpack-contrib/defaults@weizai-cli-dev/core@weizai-cli-dev/package@wejee-lego-cli/cli@wejee-lego-cli/exec@wejee-lego-cli/package@white-cli-dev/core@white-cli-dev/package@white-cli/core@wmsdev/cli-core@wmsdev/cli-model-package@wllw-cli-dev/core
5.0.0

1 year ago

4.0.0

4 years ago

3.0.0

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.0.0

8 years ago