
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
node-buffer-encoding
Advanced tools
A little wrapper around Node's Buffer that provides encoding/decoding for all supported encodings.
A little wrapper around Node's Buffer that provides encoding/decoding for all supported encodings.
If you have access to Node's Buffer you probably just want to use it directly instead. This module provides a unified API to some of my other modules, and allows me not to import "@types/node" everywhere.
npm install --save node-buffer-encoding
import Encoding from 'node-buffer-encoding';
// Encode an Uint8Array with the given encoding
Encoding.encode ( new Uint8Array ([ 0, 255 ]), 'hex' ); // => '00ff'
// Encode a string with the given encoding
Encoding.encodeStr ( 'hello', 'base64' ); // => 'aGVsbG8='
// Decode a string with the given encoding to an Uint8Array
Encoding.decode ( '00ff', 'hex' ); // => Uint8Array(2) [ 0, 255 ]
// Decode a string with the given encoding to a string
Encoding.decodeStr ( 'aGVsbG8=', 'base64' ); // => 'hello'
MIT © Fabio Spampinato
FAQs
A little wrapper around Node's Buffer that provides encoding/decoding for all supported encodings.
The npm package node-buffer-encoding receives a total of 3,150 weekly downloads. As such, node-buffer-encoding popularity was classified as popular.
We found that node-buffer-encoding demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.