
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
binquire
is a command-line utility (and underlying library) that takes binary files and encodes them as CommonJS modules. It can encode binary data as base64 strings (the most compact option), hex strings, or an array of numeric bytes. It produces a file with the format:
module.exports=BINARY;
where BINARY
is the selected binary representation of your data.
For example, exporting a file in base64 format might result in the following output:
module.exports="aGVsbG8sIHdvcmxkCg==";
To use binquire
as a command line tool, install it via npm install -g binquire
To use binquire
locally as part of your project, install it as a dependency via npm install --save binquire
After installing binquire
, you will have a binary of the same name available on your machine. The binquire
binary is used in the following way:
binquire infile [outfile] [options]
where infile
is the name of the binary file you wish to convert, outfile
is the optional name of the output JavaScript file, and options
are any of the available configuration options. If no outfile
is specified, it will be sent to stdout. The default output format is a base64 string.
Supported options are:
--hex
- Output as a hex string.--array
- Output as an array of numeric bytes.So to output image.png
to image-hex.js
, in hex-string format, you would use the following command:
binquire image.png image-hex.js --hex
require('binquire')
also exports the core functionality as a programmable API. It exports a single function:
binquire(data, options)
data
is a Node.js Buffer
object containing the binary data you want to export.
options
is an optional configuration object supporting the following keys:
type
- The type of export format, supporting the following values:
base64
(default) - Encodes the data as a base64 stringhex
- Encodes the data as a hex stringarray
- Encodes the data as a numeric array of bytesFAQs
Tool to convert binary files to require-able JS files
We found that binquire demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.