Gathering detailed insights and metrics for buffer-from
Gathering detailed insights and metrics for buffer-from
Gathering detailed insights and metrics for buffer-from
Gathering detailed insights and metrics for buffer-from
npm install buffer-from
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
23 Stars
19 Commits
10 Forks
4 Watching
2 Branches
2 Contributors
Updated on 09 Oct 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-8%
7,659,168
Compared to previous day
Last week
1.1%
45,232,957
Compared to previous week
Last month
13.3%
185,067,356
Compared to previous month
Last year
10.6%
1,870,046,820
Compared to previous year
1
A ponyfill for Buffer.from
, uses native implementation if available.
1npm install --save buffer-from
1const bufferFrom = require('buffer-from') 2 3console.log(bufferFrom([1, 2, 3, 4])) 4//=> <Buffer 01 02 03 04> 5 6const arr = new Uint8Array([1, 2, 3, 4]) 7console.log(bufferFrom(arr.buffer, 1, 2)) 8//=> <Buffer 02 03> 9 10console.log(bufferFrom('test', 'utf8')) 11//=> <Buffer 74 65 73 74> 12 13const buf = bufferFrom('test') 14console.log(bufferFrom(buf)) 15//=> <Buffer 74 65 73 74>
array
<Array>Allocates a new Buffer
using an array
of octets.
arrayBuffer
<ArrayBuffer> The .buffer
property of a TypedArray or ArrayBufferbyteOffset
<Integer> Where to start copying from arrayBuffer
. Default: 0
length
<Integer> How many bytes to copy from arrayBuffer
. Default: arrayBuffer.length - byteOffset
When passed a reference to the .buffer
property of a TypedArray instance, the
newly created Buffer
will share the same allocated memory as the TypedArray.
The optional byteOffset
and length
arguments specify a memory range within
the arrayBuffer
that will be shared by the Buffer
.
buffer
<Buffer> An existing Buffer
to copy data fromCopies the passed buffer
data onto a new Buffer
instance.
string
<String> A string to encode.encoding
<String> The encoding of string
. Default: 'utf8'
Creates a new Buffer
containing the given JavaScript string string
. If
provided, the encoding
parameter identifies the character encoding of
string
.
Buffer.alloc
Buffer.allocUnsafe
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/18 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
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