</>PackageGraphPackageGraph

safe-buffer

npmv5.2.1TypeScript

Safer Node.js Buffer API

Not recommended for new projects

No — safe-buffer should not be adopted for new projects. Last published 2264 days ago.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • FMaintenance: grade F, Failing.

    Last published 2264 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

31 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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.

PackageWeekly downloadsDependentsLicenseLast release
safe-bufferthis page03MIT6 years ago
is-unsafe01MIT2 hours ago
is-safe-filename01MIT2 hours ago
@nodable/entities02MIT2 hours ago
fast-decode-uri-component12.8M1MIT2 hours ago
@noble/hashes01MIT2 hours ago

Dependencies

Declared by safe-buffer v5.2.1. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (2)

standard *tape ^5.0.0

Used by

Popular packages that depend on safe-buffer.

Relationship graph

Dependencies (left) and dependents (right) of safe-buffer.

Frequently installed together

Release history

No releases in the last two years, typically about 132 days apart.

Recent versions of safe-buffer
VersionPublishedSizeLicense
5.2.1latest6 years ago31 KBMIT
5.2.07 years ago31 KBMIT
5.1.28 years ago31 KBMIT
5.1.19 years agoMIT
5.1.09 years agoMIT
5.0.110 years agoMIT
5.0.010 years agoMIT
4.0.010 years agoMIT
3.0.010 years agoMIT
2.0.010 years agoMIT
1.0.010 years agoMIT

Overview

safe-buffer is an npm package that safer Node.js Buffer API. It has 3 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.

Maintainers

Keywords

Funding

Frequently asked questions

Should I use safe-buffer?

No — safe-buffer should not be adopted for new projects. Last published 2264 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, 3 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.