path-exists

WebJar for path-exists

Лицензия

Лицензия

MIT
Категории

Категории

eXist Данные Базы данных
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

path-exists
Последняя версия

Последняя версия

4.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

path-exists
WebJar for path-exists
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

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

Скачать path-exists

Как подключить последнюю версию

<!-- 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"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

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.

Версии библиотеки

Версия
4.0.0
3.0.0
2.1.0
1.0.0