Node Buffer Encoding
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.
Install
npm install --save node-buffer-encoding
Usage
import Encoding from 'node-buffer-encoding';
Encoding.encode ( new Uint8Array ([ 0, 255 ]), 'hex' );
Encoding.encodeStr ( 'hello', 'base64' );
Encoding.decode ( '00ff', 'hex' );
Encoding.decodeStr ( 'aGVsbG8=', 'base64' );
License
MIT © Fabio Spampinato