Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
is-binary-path
Advanced tools
Check if a file path is a binary file
Weekly downloads
Package description
The is-binary-path npm package is used to determine if a given file path is a binary file or not. It checks the file extension against a list of known binary file types.
Check if a file path is a binary file
This feature allows you to check if a file path points to a binary file by using the file extension. It returns true if the file is a binary file, otherwise false.
const isBinaryPath = require('is-binary-path');
console.log(isBinaryPath('image.png')); // true
console.log(isBinaryPath('document.txt')); // false
The binaryextensions package provides a list of binary file extensions. It is similar to is-binary-path but does not provide a function to check the file path. Instead, it provides the raw data to be used in any way needed.
The textextensions package is the opposite of is-binary-path. It provides a list of text file extensions. This can be used in conjunction with is-binary-path to determine if a file is neither binary nor text.
The istextorbinary package provides more comprehensive functionality than is-binary-path. It not only checks file extensions but also inspects file contents to determine if a file is text or binary. This can be more accurate than is-binary-path which only uses file extensions.
Readme
Check if a file path is a binary file
$ npm install is-binary-path
const isBinaryPath = require('is-binary-path');
isBinaryPath('source/unicorn.png');
//=> true
isBinaryPath('source/unicorn.txt');
//=> false
MIT © Sindre Sorhus, Paul Miller
FAQs
Check if a file path is a binary file
The npm package is-binary-path receives a total of 24,459,276 weekly downloads. As such, is-binary-path popularity was classified as popular.
We found that is-binary-path demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.