Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

serialize-buffer-array

kevinejohn3MIT1.0.0

Serialize/Deserialize an array of Buffers

serialize, deserialize, buffer, split, join, array

readme

Serialize Buffer Array

NPM Package

Use

npm install --save serialize-buffer-array

const SerializeBufferArray = require('serialize-buffer-array')

const arr = [
  Buffer.allocUnsafe(0),
  Buffer.allocUnsafe(1),
  Buffer.allocUnsafe(255),
  Buffer.allocUnsafe(256),
  Buffer.allocUnsafe(65535),
  Buffer.allocUnsafe(65536),
  Buffer.allocUnsafe(SerializeBufferArray.MAX_SIZE)
]

const serialized = SerializeBufferArray.serialize(arr)
const deserialized = SerializeBufferArray.deserialize(serialized)
// arr === deserialized