isutf8
Check if a Node.js Buffer or Uint8Array is utf-8
Last updated 5 years ago by hcodes .
MIT · Repository · Bugs · Original npm
$ cnpm install isutf8 
SYNC missed versions from official npm registry.

NPM Version NPM Downloads Dependency Status Build Status Coverage Status

isutf8

Quick check if a Node.js Buffer or Uint8Array is UTF-8.

Install

npm install isutf8

Usage

'use strict';

const isUtf8 = require('isutf8');

const buf = Buffer.from([0xd0, 0x90]);
console.log(isUtf8(buf)); // => true

// or 

const arr = new Uint8Array([0xd0, 0x90]);
console.log(isUtf8(arr)); // => true

License

MIT License

Current Tags

  • 3.0.0                                ...           latest (5 years ago)

3 Versions

  • 4.0.0                                ...           4 years ago
  • 3.0.0                                ...           5 years ago
  • 2.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (8)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org