buffer-from
npmv1.1.2A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.
Not recommended for new projects
No — buffer-from should not be adopted for new projects. Last published 1868 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- FMaintenance: grade F, Failing.
Last published 1868 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 4.9 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding buffer-from to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- No constraint declared
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the buffer-from README.
const bufferFrom = require('buffer-from')
console.log(bufferFrom([1, 2, 3, 4]))
//=> <Buffer 01 02 03 04>
const arr = new Uint8Array([1, 2, 3, 4])
console.log(bufferFrom(arr.buffer, 1, 2))
//=> <Buffer 02 03>
console.log(bufferFrom('test', 'utf8'))
//=> <Buffer 74 65 73 74>
const buf = bufferFrom('test')
console.log(bufferFrom(buf))buffer-from vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| buffer-fromthis page | 0 | 2 | MIT | 5 years ago |
| @xtuc/ieee754 | 0 | 1 | BSD-3-Clause | 1 day ago |
| is-shared-array-buffer | 0 | 1 | MIT | 1 day ago |
| jsesc | 0 | 1 | MIT | 1 day ago |
| smart-buffer | 0 | 1 | MIT | 1 day ago |
| data-uri-to-buffer | 0 | 1 | MIT | 1 day ago |
Dependencies
Declared by buffer-from v1.1.2. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (1)
Used by
Popular packages that depend on buffer-from.
Relationship graph
Dependencies (left) and dependents (right) of buffer-from.
Frequently installed together
Lodash modular utilities.
Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
Generates and consumes source maps
Native Abstractions for Node.js: C++ header for Node 0.8 -> 26 compatibility
Release history
No releases in the last two years, typically about 78 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.1.2latest | 5 years ago | 4.9 KB | MIT |
| 1.1.1 | 8 years ago | 4.8 KB | MIT |
| 1.1.0 | 8 years ago | 3.8 KB | MIT |
| 1.0.0 | 8 years ago | 4.2 KB | MIT |
| 0.1.2 | 8 years ago | 4.2 KB | MIT |
| 0.1.1 | 10 years ago | — | MIT |
| 0.1.0 | 10 years ago | — | MIT |
Overview
buffer-from is an npm package that a [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available. It has 2 known dependents in the graph. The latest version is 1.1.2, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need a [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available and value a focused solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Clear open-source license (MIT).
- Lean dependency tree (1 direct dependencies).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Keywords
Frequently asked questions
Should I use buffer-from?
No — buffer-from should not be adopted for new projects. Last published 1868 days ago.
How do I install buffer-from?
Run `npm install buffer-from` to add buffer-from to your npm project.
What license is buffer-from released under?
buffer-from is distributed under the MIT license.
How popular is buffer-from?
npm does not publish download counts. Within PackageGraph's crawl, 2 known packages depend on buffer-from.
Is buffer-from still maintained?
The most recent release of buffer-from (v1.1.2) was published 5 years ago.
Does buffer-from run install scripts?
No. buffer-from does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.