在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):hparra/gulp-spawn开源软件地址(OpenSource Url):https://github.com/hparra/gulp-spawn开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-spawnPlugin to spawn a CLI program for piping with gulp. Uses spawn. Usagegulp-spawn options follow
Not all CLI programs support piping. In fact, many newer ones don't. Some programs require that you pass certain arguments if you intend to use stdin and/or stdout. Please check the documentation of the program you intend to use to ensure piping is supported. The following example pipes image files to ImageMagick's var spawn = require("gulp-spawn");
// example using ImageMagick's convert
// setting "buffer: false" optional but recommended for heavy I/O
gulp.src("./src/images/*.{jpg,png,gif}", { buffer: false })
.pipe(spawn({
cmd: "convert",
args: [
"-",
"-resize",
"50%",
"-"
],
// optional
opts: { cwd: "." },
filename: function(base, ext) {
return base + "-half" + ext;
}
}))
.pipe(gulp.dest("./dist/images/")); The UNIX Pipe PhilosophyIf you write spawn programs please consider taking the time to support stdin & stdout. Piping is one of the many reasons UNIX systems have endured the test of time. Changelogv0.1.0 - Initial Release
v0.2.0 - Added |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论