# valid-file

> Check if a file is a file.

Latest version **0.0.2** (published 2016-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install valid-file
pnpm add valid-file
yarn add valid-file
bun add valid-file
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-04-25 |
| First published | 2016-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Wuergler |
| Maintainers | radiovisual |
| Keywords | verify, file, exists, exist, check, validate, path, string, system, relative, absolute |

## Links

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

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-04-25
- 0.0.1 — 2016-02-16

## README

# valid-file

> Check if a file is a file.

[![Build Status](https://travis-ci.org/radiovisual/valid-file.svg?branch=master)](https://travis-ci.org/radiovisual/valid-file) [![Coverage Status](https://coveralls.io/repos/github/radiovisual/valid-file/badge.svg?branch=master)](https://coveralls.io/github/radiovisual/valid-file?branch=master)

Returns `true` if the path points to a valid file, otherwise, return `false`. 

## Install

```
$ npm install --save valid-file
```


## Usage

```js
const validFile = require('valid-file');
```

#### Async

```js
validFile('path/to/valid/file.txt', valid => {
    console.log(valid);
});
//=> true
```

#### Sync

```js
validFile.sync('path/to/valid/file.txt');
//=> true
```


## API

### validFile(path, cb)

#### path

Type: `string`

The path to the file you are verifying.

#### cb

Type: `function`  

Returns a single boolean indicating if the file is valid.

### validFile.sync(path)

Returns: `Boolean`  

The synchronous version of `validFile()`. No callback is supplied.


## License

MIT © [Michael Wuergler](http://numetriclabs.com)

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