Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
text-decoder
Advanced tools
Streaming text decoder that preserves multibyte Unicode characters.
npm i text-decoder
const TextDecoder = require('text-decoder')
const td = new TextDecoder()
td.push(Buffer.of(0xf0, 0x9f, 0x92)) // returns ''
td.push(Buffer.of(0xa9)) // returns '💩'
const td = new TextDecoder([encoding])
Create a text decoder. encoding
defaults to utf8
.
const string = td.push(data)
Push either a Buffer
or a string
to the text decoder. Returns the decoded string, buffering any partial data.
const string = td.end([data])
End the decoder, optionally pushing a final piece of data. Returns the decoded string.
Apache-2.0
FAQs
Streaming text decoder that preserves multibyte Unicode characters
The npm package text-decoder receives a total of 3,281,593 weekly downloads. As such, text-decoder popularity was classified as popular.
We found that text-decoder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.