Check if a filepath is a text file
$ npm install --save is-text-path
var isTextPath = require('is-text-path');
isTextPath('src/unicorn.txt');
//=> true
isTextPath('src/unicorn.png');
//=> false
text-extensions
- List of text file extensionsis-binary-path
- Check if a filepath is a binary fileMIT © Sindre Sorhus