isbinaryfile
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"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 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83439
108