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 
Pass in a string, array, Buffer, Data View, or Uint8Array, and get a Buffer back.
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 |
