Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

file-is-binary

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-is-binary - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

22

index.js
'use strict';
var stat = require('file-stat');
var isObject = require('isobject');

@@ -15,3 +16,3 @@ var isBinary = require('isbinaryfile');

if (file.isNull() || file.isStream() || file.isDirectory()) {
if (isNull(file) || isDirectory(file)) {
file._isBinary = false;

@@ -25,1 +26,20 @@ return false;

};
function isNull(file) {
if (typeof file.isNull !== 'function') {
file.isNull = function() {
return file.contents === null;
};
}
return file.isNull();
}
function isDirectory(file) {
if (typeof file.stat === 'undefined') {
stat.statSync(file);
file.isDirectory = function() {
return file.stat.isDirectory();
}
}
return file.isDirectory();
}

3

package.json
{
"name": "file-is-binary",
"description": "Returns true if a file is binary. Checks the actual contents, since extensions are not reliable. Basic wrapper for isbinaryfile to support vinyl files.",
"version": "0.1.2",
"version": "0.2.0",
"homepage": "https://github.com/jonschlinkert/file-is-binary",

@@ -25,2 +25,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"dependencies": {
"file-stat": "^0.2.3",
"isbinaryfile": "^3.0.1",

@@ -27,0 +28,0 @@ "isobject": "^2.1.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc