Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/is-file-utf8
Check if a file is UTF-8-encoded
https://github.com/shinnn/is-file-utf8
async-await check encoding javascript nodejs promise unicode utf-8
Last synced: 26 days ago
JSON representation
Check if a file is UTF-8-encoded
- Host: GitHub
- URL: https://github.com/shinnn/is-file-utf8
- Owner: shinnn
- License: isc
- Created: 2017-08-23T11:17:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-05T06:21:32.000Z (almost 7 years ago)
- Last Synced: 2024-10-10T15:10:07.609Z (about 1 month ago)
- Topics: async-await, check, encoding, javascript, nodejs, promise, unicode, utf-8
- Language: JavaScript
- Homepage:
- Size: 48.8 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-file-utf8
[![npm version](https://img.shields.io/npm/v/is-file-utf8.svg)](https://www.npmjs.com/package/is-file-utf8)
[![Build Status](https://travis-ci.org/shinnn/is-file-utf8.svg?branch=master)](https://travis-ci.org/shinnn/is-file-utf8)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/is-file-utf8.svg)](https://coveralls.io/github/shinnn/is-file-utf8?branch=master)Check if a file at the given path is [UTF-8](https://tools.ietf.org/html/rfc3629)-encoded
```javascript
const isFileUtf8 = require('is-file-utf8');(async () => {
await isFileUtf8('package.json'); //=> true
await isFileUtf8('screenshot.png'); //=> false
})();
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).
```
npm install is-file-utf8
```## API
```javascript
const isFileUtf8 = require('is-file-utf8');
```### isFileUtf8(*path*)
*path*: `string` [`Buffer`](https://nodejs.org/api/buffer.html#buffer_class_buffer) [`URL`](https://nodejs.org/api/url.html#url_class_url)
Return: `Promise`## License
[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe