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 2.0.0 to 2.0.1

tests/fixtures/03_russian_file.rst

2

package.json
{
"name": "isbinaryfile",
"version" : "2.0.0",
"version" : "2.0.1",
"description": "Detects if a file is binary in Node.js. Similar to Perl's -B.",

@@ -5,0 +5,0 @@ "main" : "./lib/panino.js",

isBinaryFile
============
Detects if a file is binary in Node.js. Similar to [Perl's `-B`
switch](http://stackoverflow.com/questions/899206/how-does-perl-know-a-file-is-binary),
Detects if a file is binary in Node.js. Similar to [Perl's `-B` switch](http://stackoverflow.com/questions/899206/how-does-perl-know-a-file-is-binary),
in that:

@@ -25,3 +20,3 @@

```
npm install isBinaryFile
npm install isbinaryfile
```

@@ -88,3 +83,3 @@

Then go into the _tests_ directory, and type `mocha test.js`.
Then run `npm test`.

@@ -91,0 +86,0 @@ # MIT License

@@ -25,6 +25,6 @@ "mocha";

it('should not fail on a russian text', function() {
assert(!isBinaryFile("tests/fixtures/03_Руководство_по_эксплуатации.rst"));
assert(!isBinaryFile("tests/fixtures/03_russian_file.rst"));
var bytes = fs.readFileSync("tests/fixtures/03_Руководство_по_эксплуатации.rst");
var stat = fs.lstatSync("tests/fixtures/03_Руководство_по_эксплуатации.rst");
var bytes = fs.readFileSync("tests/fixtures/03_russian_file.rst");
var stat = fs.lstatSync("tests/fixtures/03_russian_file.rst");
assert(!isBinaryFile(bytes, stat.size));

@@ -31,0 +31,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