@emmetio/html-transform

中文文档
0.3.10发布于 2018/03/29MITESM + CJS近 30 天下载 4324

Prepares given Emmet abbreviation for HTML output

原始使用文档

Emmet abbreviation transformer for HTML Build Status

This modules takes parsed Emmet abbreviation tree and transforms it for markup syntax (HTML, XML, Pug, Slim etc.) output. This transformation includes:

  • Implicit tag name resolving. Fills omitted tag names, depending on parent’s name. For example, table>.row>.cell will be resolved to table>tr.row>td.cell equivalent.
  • Item Numbering. Replaces $ symbol in node’s name, attributes and content with repeater value. For example, .item$*3 will produce nodes with item1, item2 and item3 class names. Multiple $ will zero-pad repeater value, e.g. $$$ → 001...012...123. Precede $ character with \ to skip numbering on it and keep as is.
  • Content insertion. A part of Wrap With Abbreviation action: clones implicitly repeated element (like li*) for every item of given content array and inserts item content into cloned node.

Usage

import parse from '@emmetio/abbreviation';
import transform from '@emmetio/html-transform';

const abbr = transform(parse('ul>.item$*'), ['foo', 'bar']);
// `abbr` now holds equivalent of `ul>li.item1{foo}+li.item2{bar}` abbreviation

版本与发布记录

@emmetio/html-transform 共发布 16 个版本,首次发布于 2016/11/21;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.3.10latest2018/03/298 年前
0.3.92018/01/248 年前
0.3.82018/01/108 年前
0.3.72017/12/198 年前
0.3.62017/12/018 年前
0.3.52017/09/149 年前

关于 @emmetio/html-transform 的常见问题

@emmetio/html-transform 是什么?

Prepares given Emmet abbreviation for HTML output

如何安装 @emmetio/html-transform?

在项目目录运行 npm install @emmetio/html-transform,或使用 pnpm add / yarn add / bun add。

@emmetio/html-transform 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/emmetio__html-transform 是否存在。

@emmetio/html-transform 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@emmetio/html-transform 可以商用吗?

@emmetio/html-transform 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@emmetio/html-transform 的下载量有多少?

根据 npm 官方下载统计,@emmetio/html-transform 在 2026/10/14 – 2026/11/12 这 30 天内被下载 4,324 次,日均约 144 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@emmetio/html-transform 还在维护吗?

最新版本 0.3.10 发布于 2018/03/29(8 年前);至今共发布 16 个版本,其中过去 12 个月发布了 0 个;首次发布于 2016/11/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。