Socket
Socket
Sign inDemoInstall

@stdlib/assert-is-buffer

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/assert-is-buffer

Test if a value is a Buffer object.


Version published
Weekly downloads
386K
decreased by-21.58%
Maintainers
4
Weekly downloads
 
Created

What is @stdlib/assert-is-buffer?

The @stdlib/assert-is-buffer package is a utility for checking if a value is a Buffer object. It provides a simple and efficient way to validate whether a given input is a Buffer, which is useful in various scenarios such as data processing, network communication, and file handling.

What are @stdlib/assert-is-buffer's main functionalities?

Check if a value is a Buffer

This feature allows you to check if a given value is a Buffer object. The function returns true if the value is a Buffer and false otherwise.

const isBuffer = require('@stdlib/assert-is-buffer');

const buf = Buffer.from('hello');
const notBuf = 'hello';

console.log(isBuffer(buf)); // true
console.log(isBuffer(notBuf)); // false

Other packages similar to @stdlib/assert-is-buffer

Keywords

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc