Gathering detailed insights and metrics for @stdlib/assert-is-buffer
Gathering detailed insights and metrics for @stdlib/assert-is-buffer
Gathering detailed insights and metrics for @stdlib/assert-is-buffer
Gathering detailed insights and metrics for @stdlib/assert-is-buffer
@stdlib/assert-has-node-buffer-support
Detect native Buffer support.
is-shared-array-buffer
Is this value a JS SharedArrayBuffer?
is-array-buffer
Is this value a JS ArrayBuffer?
array-buffer-byte-length
Get the byte length of an ArrayBuffer, even in engines without a `.byteLength` method.
Test if a value is a Buffer object.
npm install @stdlib/assert-is-buffer
99.7
Supply Chain
93
Quality
83
Maintenance
100
Vulnerability
80.1
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1 Stars
68 Commits
3 Watching
5 Branches
10 Contributors
Updated on 01 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-34%
55,538
Compared to previous day
Last week
-11.1%
390,400
Compared to previous week
Last month
-7.2%
1,812,648
Compared to previous month
Last year
10.8%
31,904,886
Compared to previous year
1
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Test if a value is a Buffer object.
1npm install @stdlib/assert-is-buffer
Alternatively,
script
tag without installation and bundlers, use the ES Module available on the esm
branch (see README).deno
branch (see README for usage intructions).umd
branch (see README).The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.
To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.
1var isBuffer = require( '@stdlib/assert-is-buffer' );
Tests if a value
is a Buffer
object.
1var Buffer = require( '@stdlib/buffer-ctor' ); 2 3var value = new Buffer( [ 1, 2, 3, 4 ] ); 4 5var bool = isBuffer( value ); 6// returns true
Buffer
objects.1var Int8Array = require( '@stdlib/array-int8' ); 2var Buffer = require( '@stdlib/buffer-ctor' ); 3var isBuffer = require( '@stdlib/assert-is-buffer' ); 4 5var bool = isBuffer( new Buffer( [ 1, 2, 3, 4 ] ) ); 6// returns true 7 8bool = isBuffer( new Buffer( 'beep' ) ); 9// returns true 10 11bool = isBuffer( [] ); 12// returns false 13 14bool = isBuffer( {} ); 15// returns false 16 17bool = isBuffer( new Int8Array() ); 18// returns false 19 20bool = isBuffer( function foo() {} ); 21// returns false 22 23bool = isBuffer( null ); 24// returns false 25 26bool = isBuffer( void 0 ); 27// returns false 28 29bool = isBuffer( 'beep' ); 30// returns false 31 32bool = isBuffer( 5 ); 33// returns false
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2024. The Stdlib Authors.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More