1 |
3a515b92
|
cagy
|
# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path)
|
2 |
|
|
|
3 |
|
|
> Check if a filepath is a binary file
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
## Install
|
7 |
|
|
|
8 |
|
|
```
|
9 |
|
|
$ npm install --save is-binary-path
|
10 |
|
|
```
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
## Usage
|
14 |
|
|
|
15 |
|
|
```js
|
16 |
|
|
var isBinaryPath = require('is-binary-path');
|
17 |
|
|
|
18 |
|
|
isBinaryPath('src/unicorn.png');
|
19 |
|
|
//=> true
|
20 |
|
|
|
21 |
|
|
isBinaryPath('src/unicorn.txt');
|
22 |
|
|
//=> false
|
23 |
|
|
```
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
## Related
|
27 |
|
|
|
28 |
|
|
- [`binary-extensions`](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions
|
29 |
|
|
- [`is-text-path`](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
## License
|
33 |
|
|
|
34 |
|
|
MIT © [Sindre Sorhus](http://sindresorhus.com)
|