npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@karinjs/art-template

v1.1.0

Published

JavaScript Template Engine

Readme

@karinjs/art-template

NPM Version Node.js Version

art-template 是一个简约、超快的模板引擎。它采用作用域预声明的技术来优化模板渲染速度,从而获得接近 JavaScript 极限的运行性能,并且同时支持 NodeJS 和浏览器。

本项目是对原 art-template 的重新打包优化版本,使用 vite 进行构建,大幅减小了包体积和依赖数量。

特性

  1. 拥有接近 JavaScript 渲染极限的的性能
  2. 调试友好:语法、运行时错误日志精确到模板所在行
  3. 支持 Express、Koa、Webpack
  4. 支持模板继承与子模板
  5. 浏览器版本仅 6KB 大小
  6. 零依赖,包体积小(从原版的 8.3MB 减小到 382KB)
  7. 对源代码无任何修改,发布到npm上的所有操作均由github actions自动完成
  8. 仅支持 ESM 格式

安装

# npm
npm install @karinjs/art-template

# yarn
yarn add @karinjs/art-template

# pnpm
pnpm add @karinjs/art-template

使用别名安装(兼容旧版本)

如果你正在从原版 art-template 升级,可以使用包别名方式安装,这样无需修改任何代码:

# npm 别名安装
npm install art-template@npm:@karinjs/art-template

# yarn 别名安装
yarn add art-template@npm:@karinjs/art-template

# pnpm 别名安装
pnpm add art-template@npm:@karinjs/art-template

或者在 package.json 中配置别名:

{
  "dependencies": {
    "art-template": "npm:@karinjs/art-template"
  }
}

然后执行安装命令:

npm install
# 或
yarn
# 或
pnpm install

优化对比

| 指标 | 原版 art-template | @karinjs/art-template | | -------- | ----------------- | --------------------- | | 包体积 | 8.3MB | 382KB | | 依赖数量 | 33个 | 0个 | | 模块格式 | CommonJS/UMD | 仅 ESM |

数据来源:pkg-size.dev/art-template

版本更新

  • 2025-03-29:
    • 使用 tsup 重新打包
    • 移除所有外部依赖
    • 减小包体积
    • 讨厌ci每次碰到ci都会发生不幸...
  • 2025-04-14:
    • tsup修改为使用vite
    • 仅支持 ESM 格式: 实现原理为先把art-template打包成单个cjs文件,随后对cjs文件进行二次打包成esm