fd-gulp-encodingfilter
v0.0.1
Published
filt the assigned encoding file
Downloads
28
Maintainers
Readme
基于gulp的过滤出与指定编码不符文件的插件
指定编码,例如utf-8,控制台会打印出不是utf-8编码的文件信息。形如:
the file encoding should gb2312 but file: /Users/dongming/dev/gitlab/fd-gulp-encodingfilter/test/source/qingguo/app.config.js encoding: ascii confidence 1
file: /Users/dongming/dev/gitlab/fd-gulp-encodingfilter/test/source/qingguo/js/amdtest/hello.js encoding: ascii confidence 1
file: /Users/dongming/dev/gitlab/fd-gulp-encodingfilter/test/source/qingguo/js/amdtest/hello_world.js encoding: ascii confidence 1
例子
var gulp = require('gulp');
var encodingFilter = require('fd-gulp-encodingfilter');
var sourceDir = './source/qingguo';
gulp.task('checkencoding', function() {
return gulp.src([sourceDir + '/**/*.js', sourceDir + '/**/*.html', sourceDir + '/**/*.art'])
.pipe(encodingFilter('gb2312'));
});
参数
encoding string(必须)
要过滤出不是encoding编码的文件