Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 11, 2025. It is now read-only.
/ textencoder Public archive

⚠️ Archived. See github.com/TopGunBuild/topgun

License

Notifications You must be signed in to change notification settings

TopGunBuild/textencoder

Repository files navigation

✨ @topgunbuild/textencoder

An isomorphic TextEncoder for Javascript in Node and the browser, used in TopGun

npm bundlephobia License: MIT

What?

Encode/decode Uint8Arrays to strings.

This is just a thin wrapper that provides an isomorphic API.

  • To perform UTF8 conversion in the browser it uses the native TextEncoder.
  • In Node it uses Buffer and Uint8Array.

Install

npm install @topgunbuild/textencoder

Usage

const textencoder = require('@topgunbuild/textencoder')
// or
import textencoder from '@topgunbuild/textencoder';
textencoder.encode('Hello') // Uint8Array [ 72, 101, 108, 108, 111 ]

License

MIT

About

⚠️ Archived. See github.com/TopGunBuild/topgun

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /