Check if a file path is a binary file
$ npm install is-binary-path
const isBinaryPath = require('is-binary-path'); isBinaryPath('source/unicorn.png'); //=> true isBinaryPath('source/unicorn.txt'); //=> false
MIT © Sindre Sorhus, Paul Miller