michangarrito/apps/backend/node_modules/@borewit/text-codec
rckrdmrd 48dea7a5d0 feat: Initial commit - michangarrito
Marketplace móvil para negocios locales mexicanos.

Estructura inicial:
- apps/backend (NestJS API)
- apps/frontend (React Web)
- apps/mobile (Expo/React Native)
- apps/mcp-server (Claude MCP Server)
- apps/whatsapp-service (WhatsApp Business API)
- database/ (PostgreSQL DDL)
- docs/ (Documentación)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 04:41:02 -06:00
..
lib feat: Initial commit - michangarrito 2026-01-07 04:41:02 -06:00
LICENSE.txt feat: Initial commit - michangarrito 2026-01-07 04:41:02 -06:00
package.json feat: Initial commit - michangarrito 2026-01-07 04:41:02 -06:00
README.md feat: Initial commit - michangarrito 2026-01-07 04:41:02 -06:00

CI npm version npm downloads bundlejs License: MIT

@borewit/text-codec

A lightweight text encoding/decoding polyfill for JavaScript engines (like Hermes) which lack support for certain TextEncoder / TextDecoder encoding types.

This module implements manual encoding and decoding for the most commonly used encodings, without pulling in large dependencies or experimental features.

Features

Supported encodings:

  • utf-8 / utf8
  • utf-16le
  • ascii
  • latin1 / iso-8859-1
  • windows-1252

📦 Installation

npm install @borewit/text-codec

📚 API Documentation

textDecode(bytes, encoding): string

Decodes binary data into a JavaScript string using the specified encoding.

Parameters

  • bytes (Uint8Array) — The binary data to decode.
  • encoding (SupportedEncoding, optional) — Encoding type. Defaults to "utf-8".

Returns

  • string — The decoded text.

Example

import { textDecode } from "@borewit/text-encode";

const bytes = new Uint8Array([0x48, 0x65, 0x6c, 0x6c, 0x6f]);
const text = textDecode(bytes, "ascii");
console.log(text); // "Hello"

Encodes a JavaScript string into binary form using the specified encoding.

textEncode(input, encoding): Uint8Array

Parameters

  • input (string) — The string to encode.
  • encoding (SupportedEncoding, optional) — Encoding type. Defaults to "utf-8".

Returns

Uint8Array — The encoded binary data.

Example:

import { textEncode } from "@borewit/text-encode";

const bytes = textEncode("Hello", "utf-16le");
console.log(bytes); // Uint8Array([...])

📜 Licence

This project is licensed under the MIT License. Feel free to use, modify, and distribute as needed.