Adds an `.isBinary()` function to the `file` object, similar to `file.isNull()` and `file.isStream()`.
npm install gulp-is-binary> Adds an .isBinary() function to the file object, similar to file.isNull() and file.isStream().
Install with npm:
``sh`
$ npm install --save gulp-is-binary
`js
var gulp = require('gulp');
var isBinary = require('gulp-is-binary');
gulp.task('default', function() {
return gulp.src('some/files/.')
.pipe(isBinary())
});
`
`js
var gulp = require('gulp');
var isBinary = require('gulp-is-binary');
gulp.task('default', function() {
return gulp.src('some/files/.')
.pipe(isBinary()) // this adds the .isBinary() property to the file object
.pipe(through.obj(function(file, enc, next) {
// file.isBinary() will check the file to see if it's binary,
// so we can avoid reading and potentially corrupting the file
if (file.isBinary()) {
next(null, file);
return;
}
// do stuff, now that we know that file.contents isn't binary
next(null, file);
}));
});
`
* file-contents: Set the contents property on a file object. Abstraction from vinyl-fs to support stream or… more | contentsstat property on a file object. Abstraction from vinyl-fs to support stream or non-stream usage."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* file-is-binary: Returns true if a file is binary. Checks the actual contents, since extensions are not… more | homepage
* file-stat: Set the property on a file object. Abstraction from vinyl-fs to support stream or… more | stat property on a file object. Abstraction from vinyl-fs to support stream or non-stream usage."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
_(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)_
To generate the readme, run the following command:
`sh`
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Install dev dependencies:
`sh``
$ npm install && npm test
Jon Schlinkert
* github/jonschlinkert
* twitter/jonschlinkert
Copyright © 2017, Jon Schlinkert.
MIT
*
_This file was generated by verb-generate-readme, v0.4.2, on January 30, 2017._