在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):adamayres/gulp-wrap开源软件地址(OpenSource Url):https://github.com/adamayres/gulp-wrap开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-wrap
UsageFirst, install npm install --save-dev gulp-wrap Then, add it to your Wrap the contents with an inline template: var wrap = require("gulp-wrap");
gulp.src("./src/*.json")
.pipe(wrap('angular.module(\'text\', []).value(<%= contents %>);', {}, { parse: false /* do not parse the JSON file for template data */ }))
.pipe(gulp.dest("./dist")); Wrap the contents with a template from file: var wrap = require("gulp-wrap");
gulp.src("./src/*.json")
.pipe(wrap({ src: 'path/to/template.txt'}))
.pipe(gulp.dest("./dist")); Use parsed contents within a template (supports JSON and YAML): var wrap = require("gulp-wrap");
gulp.src("./src/*.json")
.pipe(wrap('Hello, <%= contents.title %>, have a <%= contents.adjective %> day.'))
.pipe(gulp.dest("./dist")); Provide additional data and options for template processing: var wrap = require("gulp-wrap");
gulp.src("./src/*.json")
.pipe(wrap('BEFORE <%= data.contents %> <%= data.someVar %> AFTER', { someVar: 'someVal'}, { variable: 'data' }))
.pipe(gulp.dest("./dist")); This gulp plugin wraps the stream contents in a template. If you want the stream contents to be the templates use the gulp-template plugin. TemplateThe stream contents will be available in the template using the APIwrap(template[,data][,options])templateType: The template to used. When a template.srcType: The file location of the template. dataType: The data object that is passed on to the lodash template call. When a optionsType: The options object that is passed on to the lodash template call. When a options.parseType: Set to explicit options.engineType: Set the consolidate template engine to use. (default to License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论