safe-buffer
npmv5.2.1TypeScriptSafer Node.js Buffer API
Not recommended for new projects
No — safe-buffer should not be adopted for new projects. Last published 2313 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- FMaintenance: grade F, Failing.
Last published 2313 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 31 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 2 maintainers, and a contained dependency surface.
- 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 safe-buffer 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
- Types included
- Install scripts
- None
Quick start
A usage example from the safe-buffer README.
var Buffer = require('safe-buffer').Buffer
// Existing buffer code will continue to work without issues:
new Buffer('hey', 'utf8')
new Buffer([1, 2, 3], 'utf8')
new Buffer(obj)
new Buffer(16) // create an uninitialized buffer (potentially unsafe)
// But you can use these new explicit APIs to make clear what you want:
Buffer.from('hey', 'utf8') // convert from many types to a Buffer
Buffer.alloc(16) // create a zero-filled buffer (safe)
Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)safe-buffer 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 |
|---|---|---|---|---|
| safe-bufferthis page | 0 | 5 | MIT | 6 years ago |
| @nodable/entities | 0 | 2 | MIT | 1 day ago |
| is-unsafe | 0 | 1 | MIT | 1 day ago |
| is-safe-filename | 0 | 1 | MIT | 1 day ago |
| @noble/hashes | 59.6M | 1 | MIT | 1 day ago |
| json-stringify-safe | 36.4M | 1 | ISC | 1 day ago |
Dependencies
Declared by safe-buffer v5.2.1. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (2)
Used by
Popular packages that depend on safe-buffer.
Deprecate all the things
Create simple HTTP ETags
HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.
Opinionated, caching, retrying fetch client
Simplified HTTP request client.
Relationship graph
Dependencies (left) and dependents (right) of safe-buffer.
Frequently installed together
An AST-based pattern checker for JavaScript.
RFC9562 UUIDs
The ultimate javascript content-type utility.
HTTP content negotiation
Port of jQuery.extend for node.js and the browser
just emit 'log' events on the process object
HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.
Like JSON.stringify, but doesn't blow up on circular refs.
create a pipeline of streams using Minipass
Signs and prepares requests using AWS Signature Version 4
Reference implementation of Joyent's HTTP Signature scheme.
Caseless object set/get/has, very useful when working with HTTP headers.
Release history
No releases in the last two years, typically about 132 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 5.2.1latest | 6 years ago | 31 KB | MIT |
| 5.2.0 | 7 years ago | 31 KB | MIT |
| 5.1.2 | 8 years ago | 31 KB | MIT |
| 5.1.1 | 9 years ago | — | MIT |
| 5.1.0 | 9 years ago | — | MIT |
| 5.0.1 | 10 years ago | — | MIT |
| 5.0.0 | 10 years ago | — | MIT |
| 4.0.0 | 10 years ago | — | MIT |
| 3.0.0 | 10 years ago | — | MIT |
| 2.0.0 | 10 years ago | — | MIT |
| 1.0.0 | 10 years ago | — | MIT |
Overview
safe-buffer is an npm package that safer Node.js Buffer API. It has 5 known dependents in the graph. The latest version is 5.2.1, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need safer Node.js Buffer API and value a focused solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
- Lean dependency tree (2 direct dependencies).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Funding
Frequently asked questions
Should I use safe-buffer?
No — safe-buffer should not be adopted for new projects. Last published 2313 days ago.
How do I install safe-buffer?
Run `npm install safe-buffer` to add safe-buffer to your npm project.
What license is safe-buffer released under?
safe-buffer is distributed under the MIT license.
How popular is safe-buffer?
npm does not publish download counts. Within PackageGraph's crawl, 5 known packages depend on safe-buffer.
Is safe-buffer still maintained?
The most recent release of safe-buffer (v5.2.1) was published 6 years ago.
Does safe-buffer run install scripts?
No. safe-buffer does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.