在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):rschmukler/gulp-insert开源软件地址(OpenSource Url):https://github.com/rschmukler/gulp-insert开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-insertString manipulation library for gulp Usage
var insert = require('gulp-insert'); AppendAppends a string onto the contents. .pipe(insert.append('world')); // Appends 'world' to the contents of every file PrependPrepends a string onto the contents. .pipe(insert.prepend('Hello')); // Prepends 'Hello' to the contents of every file WrapWraps the contents with two strings. .pipe(insert.wrap('Hello', 'World')); // prepends 'hello' and appends 'world' to the contents TransformCalls a function with the contents of the file. .pipe(insert.transform(function(contents, file) {
return contents.toUpperCase();
})); Transform has access to the underlying vinyl file. The following code adds a '//' comment with the full file name before the actual content. .pipe(insert.transform(function(contents, file) {
var comment = '// local file: ' + file.path + '\n';
return comment + contents;
})); See https://github.com/wearefractal/vinyl for docmentation on the 'file' parameter. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论