Socket
Socket
Sign inDemoInstall

isbinaryfile

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isbinaryfile - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

18

lib/index.js

@@ -20,8 +20,5 @@ "use strict";

if (isString(file)) {
const filepath = file;
const stat = yield statAsync(filepath);
if (!stat.isFile()) {
throw new Error(`Path provided was not a file!`);
}
const fileDescriptor = yield openAsync(filepath, 'r');
const stat = yield statAsync(file);
isStatFile(stat);
const fileDescriptor = yield openAsync(file, 'r');
const allocBuffer = Buffer.alloc(MAX_BYTES);

@@ -54,5 +51,3 @@ // Read the file with no encoding for raw buffer access.

const stat = fs.statSync(file);
if (!stat.isFile()) {
throw new Error(`Path provided was not a file!`);
}
isStatFile(stat);
const fileDescriptor = fs.openSync(file, 'r');

@@ -142,1 +137,6 @@ const allocBuffer = Buffer.alloc(MAX_BYTES);

}
function isStatFile(stat) {
if (!stat.isFile()) {
throw new Error(`Path provided was not a file!`);
}
}
{
"name": "isbinaryfile",
"description": "Detects if a file is binary in Node.js. Similar to Perl's -B.",
"version": "4.0.0",
"version": "4.0.1",
"keywords": [

@@ -24,3 +24,3 @@ "text",

"@types/node": "^10.12.18",
"jest": "^23.6.0",
"jest": "^24.8.0",
"prettier": "^1.15.3",

@@ -27,0 +27,0 @@ "release-it": "^9.6.2",

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