Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-art-tpl

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-art-tpl

A gulp plugin for art-template. 解析 art-template 模板引擎语法的gulp插件.

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

gulp-art-tpl

A gulp plugin for art-template.

用于解析 art-template 模板引擎语法的gulp插件。它能让你快速在 Gulp 工作流中处理 art-template 文件。

Install

npm install --save-dev gulp-art-tpl

Usage

👉 查看 art-template 语法>>

const gulp = require('gulp')
const template = require('gulp-art-tpl')
const rename = require('gulp-rename')

gulp.task('build:html', function() {
  gulp.src('./src/*.{art,html,ejs}')
    .pipe(template({
      title: 'art-template',
      author: 'Mervin'
    }))
    .pipe(rename({
      extname: '.html'
    }))
    .pipe(gulp.dest('dist/'))
})
<!-- demo.html -->
<div>
  <h1>{{title}}</h1>
  <p>{{author}}</p>
</div>

<!-- or -->
<div>
  <h1><%= title %></h1>
  <p><%= author%></p>
</div>

Output:

<div>
  <h1>art template</h1>
  <p>Mervin</p>
</div>
  1. art-template 同时支持标准语法和原始语法;
  2. 原始语法兼容 EJS , LoDash 模板。

API

template(data, options)

data

需要渲染的数据

  • type - object

options

编译选项,具体查看 template.defaults

  • type - object

Keywords

FAQs

Package last updated on 20 Jul 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc