path-exists

WebJar for path-exists

License

License

MIT
Categories

Categories

eXist Data Databases
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

path-exists
Last Version

Last Version

4.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

path-exists
WebJar for path-exists
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/path-exists

Download path-exists

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/path-exists/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>path-exists</artifactId>
    <version>4.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/path-exists/
implementation 'org.webjars.npm:path-exists:4.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/path-exists/
implementation ("org.webjars.npm:path-exists:4.0.0")
'org.webjars.npm:path-exists:jar:4.0.0'
<dependency org="org.webjars.npm" name="path-exists" rev="4.0.0">
  <artifact name="path-exists" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='path-exists', version='4.0.0')
)
libraryDependencies += "org.webjars.npm" % "path-exists" % "4.0.0"
[org.webjars.npm/path-exists "4.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

path-exists Build Status

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
const pathExists = require('path-exists');

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

API

pathExists(path)

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

pathExists.sync(path)

Returns a boolean of whether the path exists.

Related

  • path-exists-cli - CLI for this module
  • path-type - Check if a path exists and whether it's a file, directory, or symlink

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Version
4.0.0
3.0.0
2.1.0
1.0.0