SkillAgentSearch skills...

Isutf8

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

Install / Use

/learn @hcodes/Isutf8
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

NPM Version NPM Downloads install size

isutf8

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

Advantages

  • Ultra-small package size
  • No dependencies
  • No pre-compilation

Install

npm install isutf8

Usage

CommonJS

const isUtf8 = require('isutf8');

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

// or 

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

ES Modules or TypeScript

import isUtf8 from 'isutf8';

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

// or 

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

License

MIT License

View on GitHub
GitHub Stars21
CategoryDevelopment
Updated6d ago
Forks3

Languages

TypeScript

Security Score

95/100

Audited on Mar 27, 2026

No findings