You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
678 B
35 lines
678 B
2 years ago
|
# is-text-path [](https://travis-ci.org/sindresorhus/is-text-path)
|
||
|
|
||
|
> Check if a filepath is a text file
|
||
|
|
||
|
|
||
|
## Install
|
||
|
|
||
|
```
|
||
|
$ npm install --save is-text-path
|
||
|
```
|
||
|
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
```js
|
||
|
var isTextPath = require('is-text-path');
|
||
|
|
||
|
isTextPath('src/unicorn.txt');
|
||
|
//=> true
|
||
|
|
||
|
isTextPath('src/unicorn.png');
|
||
|
//=> false
|
||
|
```
|
||
|
|
||
|
|
||
|
## Related
|
||
|
|
||
|
- [`text-extensions`](https://github.com/sindresorhus/text-extensions) - List of text file extensions
|
||
|
- [`is-binary-path`](https://github.com/sindresorhus/is-binary-path) - Check if a filepath is a binary file
|
||
|
|
||
|
|
||
|
## License
|
||
|
|
||
|
MIT © [Sindre Sorhus](http://sindresorhus.com)
|