is-file-utf8
v1.0.1
Published
Check if a file at the given path is UTF-8-encoded
Downloads
8
Maintainers
Readme
is-file-utf8
Check if a file at the given path is UTF-8-encoded
const isFileUtf8 = require('is-file-utf8');
(async () => {
await isFileUtf8('package.json'); //=> true
await isFileUtf8('screenshot.png'); //=> false
})();
Installation
npm install is-file-utf8
API
const isFileUtf8 = require('is-file-utf8');
isFileUtf8(path)
path: string
Buffer
URL
Return: Promise<boolean>
License
ISC License © 2018 Shinnosuke Watanabe