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 🙏

© 2026 – Pkg Stats / Ryan Hefner

njk-tool

v0.1.0

Published

nunjucks no JavaScript 模板工具,兼容jinja

Downloads

37

Readme

njk-tool

Nunjucks 模板渲染工具,用于快速生成 HTML 报告和文档

特性

  • 🎨 丰富的组件系统 - 标题、表格、提示框、目录等
  • 📧 邮件集成 - 支持将渲染结果直接发送邮件
  • 🔧 零 JavaScript 编程 - 通过 JSON 配置即可生成 HTML
  • 📱 响应式设计 - 内置移动端适配样式

快速开始

安装

npm install njk-tool

基础用法

import { njkRenderSync } from 'njk-tool';

const html = njkRenderSync([
  {
    tag: 'title',
    type: 'h1',
    text: '我的报告'
  },
  {
    tag: 'table',
    columns: ['Name', 'Age'],
    data: [
      { Name: 'Alice', Age: 25 },
      { Name: 'Bob', Age: 30 }
    ]
  }
]);

开发

安装依赖

pnpm install

启动开发服务器

pnpm run dev

访问 http://localhost:3007/example/report_test 查看示例

配置邮件功能(可选)

复制 .env.example.env 并配置:

SMTP_HOST=smtp.qq.com
SMTP_PORT=465
SMTP_SECURE=true
[email protected]
SMTP_PASS=your授权码
[email protected]

组件列表

  • title - 标题组件(h1-h6)
  • table - 表格组件
  • notice - 提示框(info/success/warning/error)
  • date - 日期显示
  • checker - 检查人信息
  • toc - 目录导航
  • block - 代码块
  • text - 文本内容
  • divider - 分隔线
  • tag - 标签
  • title_content - 可折叠内容块

License

MIT