0.3.1 • Published 4 years ago

@asm/utf8 v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@asm/utf8

A fast UTF-8 encoding and decoding tools.

npm Build Status Coverage Status

Installation

With npm:

npm install @asm/utf8

With yarn:

yarn add @asm/utf8

Usage

ES Modules

// Browser | Node v13.2
import { strToUtf8, utf8ToStr } from '@asm/utf8';        // ES6 (codePoint)
import { strToUtf8, utf8ToStr } from '@asm/utf8/legacy'; // ES5 (charCode)

// Node v12.8 --experimental-modules
// Node v12.0 --experimental-modules --es-module-specifier-resolution=node
// Node v8.6  --experimental-modules
import { strToUtf8, utf8ToStr } from '@asm/utf8/index';

CommonJS

const { strToUtf8, utf8ToStr } = require('@asm/utf8');

API

countUtf8(str[, offset, length])
strToUtf8(str[, offset, length])
strToUint8(str[, offset, length])
utf8ToStr(bin[, offset, length])
viewToStr(view[, offset, length])

License

MIT