is-file-utf8

1.0.1 • Public • Published

is-file-utf8

npm version Build Status Coverage Status

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

Use npm.

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

Package Sidebar

Install

npm i is-file-utf8

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • shinnn