to-buffer (1.2.1)

Published 2026-02-24 14:06:16 +00:00 by atheaadmin

Installation

registry=
npm install to-buffer@1.2.1
"to-buffer": "1.2.1"

About this package

to-buffer Version Badge

Pass in a string, array, Buffer, Data View, or Uint8Array, and get a Buffer back.

github actions coverage dependency status dev dependency status License Downloads

npm badge

npm install to-buffer

Usage

var toBuffer = require('to-buffer');

console.log(toBuffer('hi')); // <Buffer 68 69>
console.log(toBuffer(Buffer('hi'))); // <Buffer 68 69>
console.log(toBuffer('6869', 'hex')); // <Buffer 68 69>
console.log(toBuffer(43)); // throws

Dependencies

Dependencies

ID Version
isarray ^2.0.5
safe-buffer ^5.2.1
typed-array-buffer ^1.0.3

Development Dependencies

ID Version
@ljharb/eslint-config ^21.1.1
auto-changelog ^2.5.0
available-typed-arrays ^1.0.7
encoding ^0.1.13
eslint =8.8.0
for-each ^0.3.5
npmignore ^0.3.1
nyc ^10.3.2
tape ^5.9.0
Details
npm
2026-02-24 14:06:16 +00:00
0
Mathias Buus
MIT
latest
5.6 KiB
Assets (1)
Versions (1) View all
1.2.1 2026-02-24