内容简介:Easy HTML templating with JS. Tagtag prints out HTML string, so it's especially useful with Node.js (works in browsers as well). Express template engine middleware coming soon!
tagtag
Easy HTML templating with JS. Tagtag prints out HTML string, so it's especially useful with Node.js (works in browsers as well). Express template engine middleware coming soon!
Install
npm i tagtag
Usage
Import / require
// If you're using ES modules:
import tag from 'tagtag'
// If you're using CommonJS modules:
const tag = require('tagtag');
tag(query)(...args)
tag('h1')('Hello world!'); // <h1>Hello world!</h1>
tag('.hello')('world'); // <div>world</div>
tag('#hello.world')('!'); // <div id="hello"></div>
const doc = tag('doctype html');
const html = tag('html');
const head = tag('head');
const meta = tag('meta');
const title = tag('title');
const body = tag('body');
const h1 = tag('h1');
doc(
html(
head(
meta({ charset: 'utf-8' }),
title('Hello tagtag!')
),
body(
h1('Hello tagtag!')
)
)
) // <!DOCTYPE html><html><head><meta charset="utf-8"><title>Hello tagtag!</title></head><body><h1>Hello tagtag!</h1></body></html>
以上所述就是小编给大家介绍的《tagtag》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Java并发编程的艺术
方腾飞、魏鹏、程晓明 / 机械工业出版社 / 2015-7-1 / 59.00元
并发编程领域的扛鼎之作,作者是阿里和1号店的资深Java技术专家,对并发编程有非常深入的研究,《Java并发编程的艺术》是他们多年一线开发经验的结晶。本书的部分内容在出版早期发表在Java并发编程网和InfoQ等技术社区,得到了非常高的评价。它选取了Java并发编程中最核心的技术进行讲解,从JDK源码、JVM、CPU等多角度全面剖析和讲解了Java并发编程的框架、工具、原理和方法,对Java并发编......一起来看看 《Java并发编程的艺术》 这本书的介绍吧!