# file-exists-promise

> fs.exists with ES6 Promise that is not deprecated

Latest version **1.0.2** (published 2016-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install file-exists-promise
pnpm add file-exists-promise
yarn add file-exists-promise
bun add file-exists-promise
```

## 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.2 |
| Published | 2016-04-24 |
| First published | 2016-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tan Li Hau |
| Maintainers | tanhauhau |
| Keywords | fs, file, exists, promise, es6-promise, async |

## Links

- npm: https://www.npmjs.com/package/file-exists-promise
- Repository: https://github.com/tanhauhau/file-exists-promise
- Homepage: https://github.com/tanhauhau/file-exists-promise#readme
- Issues: https://github.com/tanhauhau/file-exists-promise/issues
- npm.io page: https://npm.io/package/file-exists-promise

## Dependencies (1)

- [es6-promise](https://npm.io/package/es6-promise.md) ^3.1.2

## 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.2 (latest) — 2016-04-24
- 1.0.1 — 2016-04-23
- 1.0.0 — 2016-04-23

## README

# file-exists-promise

[![Build Status](https://travis-ci.org/tanhauhau/file-exists-promise.svg?branch=master)](https://travis-ci.org/tanhauhau/file-exists-promise)
[![npm version](https://badge.fury.io/js/file-exists-promise.svg)](https://badge.fury.io/js/file-exists-promise)
[![Dependency status](https://david-dm.org/tanhauhau/file-exists-promise.svg)](https://david-dm.org)
[![Downloads](https://img.shields.io/npm/dt/file-exists-promise.svg)](https://www.npmjs.com/package/file-exists-promise)
[![Donate](https://img.shields.io/gratipay/user/tanhauhau.svg)](https://gratipay.com/~tanhauhau/)

> fs.exists with ES6 Promise that is not deprecated
>
> This is the implementation using [fs.statsSync](https://nodejs.org/api/fs.html#fs_fs_statsync_path) to check whether the file exists instead of the deprecated [fs.existsSync](https://nodejs.org/api/fs.html#fs_fs_existssync_path).
>


# Installation

```bash
$ npm install --save file-exists-promise
```

## Usage

```javascript
var fileExists = require('file-exists-promise'),
      path = require('path');

      fileExists(path.resolve(__dirname, './file.txt'))
      .then(function(stat){
          console.log('yeah it exists!');
          console.log('and the stat of the file --> ' + stat);
      })
      .catch(function(){
          console.log('oh no... it does not exist');
      });
```

# License
MIT

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