oak-barrel
v1.0.1
Published
A simple format for storing and transferring an individual, variable-length binary data object within a byte array
Downloads
5
Readme
oak-barrel
A barrel is a simple format for storing and transferring individual, variable-length binary objects within a byte array.
Getting Started
Install the oak-barrel
package into your project with npm.
npm install oak-barrel --save
Use the oak-barrel
module in your project.
import Barrel from 'oak-barrel'; // ES6
var Barrel = require('oak-barrel'); // ES5
// Convert from a String into a barrel-formatted Buffer
let barrel = Barrel.fromText('Hello, World!');
// <Buffer 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 ff>
// Convert from a barrel-formatted Buffer into a String
let text = Barrel.toText(barrel);
// 'Hello, World!'
API
The public interface for oak-barrel
is defined in the API Guide.
Contributing
Pull requests are welcome! To get started, see the Contributing Guide.