Skip to content

alessioalex/is-binary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-binary

Detects if a file is binary based on its content. build status

Usage

isBinary(content)

Example:

var assert = require('assert');
var fs = require('fs');
var isBinary = require('is-binary');

assert.equal(isBinary(fs.readFileSync('sample.pdf', 'utf8')) === false);

Tests

npm test

Inspiration

Main source code extracted from https://github.com/bevry/istextorbinary/, MIT licensed.

Tests inspired by https://github.com/gjtorikian/isBinaryFile, MIT licensed.

License

MIT http://alessioalex.mit-license.org/

About

Detects if a file is binary based on its content.

Resources

Stars

Watchers

Forks

Packages

No packages published