@asm/utf8
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

@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

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i @asm/utf8

    Weekly Downloads

    1

    Version

    0.3.1

    License

    MIT

    Unpacked Size

    121 kB

    Total Files

    63

    Last publish

    Collaborators

    • asm