New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mill-gulp-utils

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mill-gulp-utils

about gulp tools

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

mill-gulp-utils

关于gulp的一些工具封装

轻量级的自定义插件

var mplug=require("mill-gulp-utils").mplug;
var gulp=require("gulp");
var gutil=require("gulp-util");
module.exports=function  () {
	gulp.src('test/**/*.js')
	.pipe(mplug(function  (gutil,file,enc,content) {
		//自定义插件
		gutil.log(gutil.colors.red(file.path));
		gutil.log(content);
		return content;//需要返回content
	})).pipe(gulp.dest("dist"));
}

独立的自定义插件

var tpl=require("mill-gulp-utils").tpl;
module.exports=tpl({
  PLUGIN_NAME:'t2',
  argsTrue:function (arguments) {
    return arguments.length>=1;
  },
  doPlagin:function  (gutil,file,enc,content) {
    gutil.log(content);
    return content;
  }
});

新版的gulp插件

export default GulpTemplate((code, file) => {
    const ast = parse(code, parseOption)
    traverse(ast, {
        enter(path) {
            delete path.node.loc
            delete path.node.start
            delete path.node.end
            delete path.node.directives
        }
    })
    return stringify(ast.program)
})

FAQs

Package last updated on 25 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts