🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

react-native-nitro-text-decoder

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-nitro-text-decoder

react-native-nitro-text-decoder

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
60K
63.8%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-nitro-text-decoder

TextDecoder implementation backed by Nitro Modules for React Native.

Installation

npm i react-native-nitro-text-decoder react-native-nitro-modules

Usage

import { TextDecoder } from 'react-native-nitro-text-decoder'

const decoder = new TextDecoder()
const text = decoder.decode(new Uint8Array([72, 101, 108, 108, 111])) // "Hello"

decode accepts:

  • ArrayBuffer
  • ArrayBufferView (for example Uint8Array, Int8Array, DataView)

Constructor options

import { TextDecoder } from 'react-native-nitro-text-decoder'

const decoder = new TextDecoder('utf-8', {
  fatal: false,
  ignoreBOM: true,
})

Streaming decode (chunked UTF-8)

If you decode incrementally (for example from an HTTP stream), reuse the same decoder and pass { stream: true } for intermediate chunks:

import { TextDecoder } from 'react-native-nitro-text-decoder'

const decoder = new TextDecoder('utf-8')

// For each chunk:
const chunkText = decoder.decode(chunkUint8Array, { stream: true })

// On the final chunk, you can omit it or set stream to false:
const finalText = decoder.decode(lastChunk, { stream: false })

API Reference

class TextDecoder

  • constructor(label?: string, options?: { fatal?: boolean; ignoreBOM?: boolean })
  • encoding: string
  • fatal: boolean
  • ignoreBOM: boolean
  • decode(input?: ArrayBuffer | ArrayBufferView, options?: { stream?: boolean }): string

Keywords

react-native

FAQs

Package last updated on 18 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts