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 3.0.2 to 3.0.3

7

index.js
var fs = require('fs');
var path = require("path");
var path = require('path');
var alloc = require('buffer-alloc');
var MAX_BYTES = 512;

@@ -16,3 +17,3 @@

if (r_err) return cb(r_err);
bytes = new Buffer(MAX_BYTES);
bytes = alloc(MAX_BYTES);
// Read the file with no encoding for raw buffer access.

@@ -120,3 +121,3 @@ fs.read(descriptor, bytes, 0, bytes.length, 0, function(err, size, bytes){

// Read the file with no encoding for raw buffer access.
bytes = new Buffer(MAX_BYTES);
bytes = alloc(MAX_BYTES);
size = fs.readSync(descriptor, bytes, 0, bytes.length, 0);

@@ -123,0 +124,0 @@ } finally {

{
"name": "isbinaryfile",
"description": "Detects if a file is binary in Node.js. Similar to Perl's -B.",
"version": "3.0.2",
"version": "3.0.3",
"dependencies": {
"buffer-alloc": "^1.2.0"
},
"devDependencies": {

@@ -6,0 +9,0 @@ "mocha": "^2.2.4",

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