在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):rogeriopvl/gulp-mustache开源软件地址(OpenSource Url):https://github.com/rogeriopvl/gulp-mustache开源编程语言(OpenSource Language):JavaScript 97.1%开源软件介绍(OpenSource Introduction):gulp-mustache
UsageFirst, install npm install --save-dev gulp-mustache Then, add it to your var mustache = require("gulp-mustache");
gulp.src("./templates/*.mustache")
.pipe(mustache({
msg: "Hello Gulp!"
}))
.pipe(gulp.dest("./dist")); You may also pass in an object representing mustache partials and their contents
as a third argument to the call to With key/value pairs: gulp.src("./templates/*.mustache")
.pipe(mustache({
msg: "Hello Gulp!",
nested_value: "I am nested.",
another_value: "1 2 3"
},{},{
some_inner_partial: "<p>{{nested_value}}</p>",
another_partial: "<div>{{another_value}}</div>"
})).pipe(gulp.dest("./dist")); With a json file: gulp.src("./templates/*.mustache")
.pipe(mustache('your_json_file.json',{},{}))
.pipe(gulp.dest("./dist")); Partials loaded from diskMustache partials not given in the
This will find a APImustache(view, options, partials)viewType: The view object, containing all template variables as keys. If you pass a As of optionsType: The options object to configure the plugin. options.extensionType: options.tagsType Pass custom mustache delimiters. This must be an Array of strings where the first item is the opening tag and the second the closing tag. Example: ['{{custom', 'custom}}'] partialsType: An optional object of mustache partial strings. See mustache.js for details on partials in mustache. License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论