# existent

> Check if one or more paths exist, promise-less

Latest version **1.0.1** (published 2015-12-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install existent
pnpm add existent
yarn add existent
bun add existent
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-12-29 |
| First published | 2015-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vincent Weevers |
| Maintainers | vweevers |
| Keywords | access, exist, exists, file, fs, path |

## Links

- npm: https://www.npmjs.com/package/existent
- Repository: https://github.com/vweevers/node-existent
- Issues: https://github.com/vweevers/node-existent/issues
- npm.io page: https://npm.io/package/existent

## Dependencies (1)

- [after](https://npm.io/package/after.md) ~0.8.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-12-29

## README

# existent

**Check if one or more paths exist, promise-less.**

[![npm status](http://img.shields.io/npm/v/existent.svg?style=flat-square)](https://www.npmjs.org/package/existent) [![Travis build status](https://img.shields.io/travis/vweevers/node-existent.svg?style=flat-square&label=travis)](http://travis-ci.org/vweevers/node-existent) [![AppVeyor build status](https://img.shields.io/appveyor/ci/vweevers/node-existent.svg?style=flat-square&label=appveyor)](https://ci.appveyor.com/project/vweevers/node-existent) [![Dependency status](https://img.shields.io/david/vweevers/node-existent.svg?style=flat-square)](https://david-dm.org/vweevers/node-existent)

## examples

```js
const existent = require('existent')

existent('sheep.txt', (err, missing) => {
  console.log(err.message) // "File does not exist: /cwd/sheep.txt"
  console.log(missing) // ["/cwd/sheep.txt"]
})

// Takes an optional base path
existent(['a', '../b', 'c'], '/things', (err) => {
  if (err) throw err // "2 files do not exist: /b, /things/c"
})

// Synchronous variant (returns boolean)
existent.sync('package.json', ['node_modules', 'chalk'])

// Assertion
existent.assert(['penguin.js', 'flamingo.js'], 'lib')
```

## api

### `existent(path(s), [base], callback)`

Asynchronous variant. If `base` is provided (a string or array), it will be prepended to each `path`. The callback receives three arguments:

1. error or null
2. array of resolved missing paths
3. array of resolved existing paths

### `existent.sync(path(s), [base])`

Synchronous variant, returns a boolean.

### `existent.assert(path(s), [base])`

Throws if one or more paths do not exist.

## install

With [npm](https://npmjs.org) do:

```
npm install existent --save
```

## license

[MIT](http://opensource.org/licenses/MIT) © Vincent Weevers

---
_Source: https://npm.io/package/existent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
