Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexmasterov/utf8.js
A fast UTF-8 encoding and decoding tools
https://github.com/alexmasterov/utf8.js
binary decoding encoding javascript typescript utf8
Last synced: about 4 hours ago
JSON representation
A fast UTF-8 encoding and decoding tools
- Host: GitHub
- URL: https://github.com/alexmasterov/utf8.js
- Owner: AlexMasterov
- License: mit
- Created: 2018-10-14T03:50:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-02T17:31:52.000Z (almost 5 years ago)
- Last Synced: 2023-12-30T09:48:17.939Z (10 months ago)
- Topics: binary, decoding, encoding, javascript, typescript, utf8
- Language: JavaScript
- Homepage:
- Size: 110 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @asm/utf8
A fast UTF-8 encoding and decoding tools.
[![npm](https://img.shields.io/github/package-json/v/AlexMasterov/utf8.js)](https://www.npmjs.com/package/@asm/utf8)
[![Build Status](https://travis-ci.org/AlexMasterov/utf8.js.svg)](https://travis-ci.org/AlexMasterov/utf8.js)
[![Coverage Status](https://coveralls.io/repos/github/AlexMasterov/utf8.js/badge.svg?branch=master)](https://coveralls.io/github/AlexMasterov/utf8.js?branch=master)## Installation
With [npm](https://www.npmjs.com/package/npm):
```sh
npm install @asm/utf8
```
With [yarn](https://yarnpkg.com):
```sh
yarn add @asm/utf8
```
## Usage
__ES Modules__
```js
// 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__
```js
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](LICENSE)