Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
bin-check
Advanced tools
Package description
The bin-check npm package is used to check if a binary is working by executing it with optional arguments and checking the exit code. It is useful for validating if a binary is correctly installed and operational in the environment where your Node.js application is running.
Check if a binary is working
This feature allows you to check if a binary is working by running it with the '--version' argument (or any other argument you wish to use) and returns a promise that resolves with a boolean indicating if the binary works.
const binCheck = require('bin-check');
binCheck('/path/to/binary', ['--version']).then(works => {
console.log(works ? 'Binary is working!' : 'Binary is not working.');
}).catch(error => {
console.error('An error occurred:', error);
});
Execa is a process execution tool that is more general-purpose than bin-check. It can be used to execute binaries and handle their output, but it does not specifically check if a binary works. It provides more detailed control over the execution environment and the child process.
The 'which' package is a simple utility to find the path of a binary in the system's PATH. It is similar to the Unix 'which' command. Unlike bin-check, it does not execute the binary to check if it's working; it only locates it.
This package is used to check if a given command is available in the system's PATH, similar to 'which'. It does not execute the binary but simply checks for its existence, making it less thorough than bin-check for verifying if a binary is operational.
Readme
Check if a binary is working by checking its exit code
$ npm install bin-check
const binCheck = require('bin-check');
binCheck('/bin/sh', ['--version']).then(works => {
console.log(works);
//=> true
});
Returns a Promise
for a boolean
.
Returns a boolean
.
Type: string
Path to the binary.
Type: Array
Default: ['--help']
Arguments to run the binary with.
MIT © Kevin Mårtensson
FAQs
Check if a binary is working
The npm package bin-check receives a total of 1,538,718 weekly downloads. As such, bin-check popularity was classified as popular.
We found that bin-check 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.