
Security News
NVD Quietly Sweeps 100K+ CVEs Into a “Deferred” Black Hole
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.
binary-extensions
Advanced tools
The binary-extensions npm package provides a list of binary file extensions. This package can be used to check if a file extension is generally considered to be binary. It is useful when handling file uploads, file processing, or any other file-related operations where knowing if a file is binary or text can be crucial.
Check if an extension is binary
This code checks if the 'png' extension is included in the list of binary extensions, indicating that files with this extension are binary.
const binaryExtensions = require('binary-extensions');
if (binaryExtensions.includes('png')) {
console.log('The file extension is binary.');
} else {
console.log('The file extension is not binary.');
}
This package provides a function to check if a given path is a binary file path. It is similar to binary-extensions but works with full file paths instead of just extensions.
As the counterpart to binary-extensions, text-extensions provides a list of text file extensions. It can be used to determine if a file extension is generally considered to be text, which is the opposite use case of binary-extensions.
List of binary file extensions
The list is just a JSON file and can be used anywhere.
npm install binary-extensions
import binaryExtensions from 'binary-extensions';
console.log(binaryExtensions);
//=> ['3ds', '3g2', …]
FAQs
List of binary file extensions
The npm package binary-extensions receives a total of 38,403,773 weekly downloads. As such, binary-extensions popularity was classified as popular.
We found that binary-extensions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.
Research
Security News
Lazarus-linked threat actors expand their npm malware campaign with new RAT loaders, hex obfuscation, and over 5,600 downloads across 11 packages.
Security News
Safari 18.4 adds support for Iterator Helpers and two other TC39 JavaScript features, bringing full cross-browser coverage to key parts of the ECMAScript spec.