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

slinejs

v1.0.0

Published

Single-file ESM build of the Sline template engine.

Readme

slinejs

slinejs 是 Sline 模板引擎的单文件 ESM 发布包。npm 包只暴露根入口 sline.js,适合直接在 Node 或现代浏览器中通过 import 使用。

安装

npm install slinejs

使用

Node / Bundler

import Sline from 'slinejs';

const sline = new Sline({ strict: false });
const template = sline.compile(`
  <ul>
    {{#for product in products}}
      <li>{{product.title}} - {{product.price | money("$")}}</li>
    {{/for}}
  </ul>
`);

const html = template({
  products: [
    { title: 'Orange Slice Drops', price: 389 },
    { title: 'Pearl Drop Ring', price: 109 },
  ],
});

浏览器 ESM

<script type="module">
  import Sline from './sline.js';

  const sline = new Sline();
  const html = sline.render('<h1>{{shop.name}}</h1>', {
    shop: { name: 'Sline Demo' },
  });

  document.body.innerHTML = html;
</script>

支持的核心能力

  • compile() / render() 模板编译与渲染
  • 内置 Bottle 风格的 helper / filter
  • registerHelper() / registerFilter() 注册自定义扩展
  • registerPartial() / registerComponent() 注册局部模板与组件
  • registerTranslation() / registerTranslations() 注入翻译字典
  • 模板缓存与 strict mode

说明

  • 这个 npm 包的业务文件只发布根入口 sline.jsREADME.mdpackage.json 会由 npm 自动附带。
  • 仓库里的 core/runtime/demo.htmltests/ 等文件仍保留在源码仓库中,用于开发和验证,不随 npm 包一起发布。
  • 如果你需要源码、示例或完整文档,请查看仓库:maxlee/sline.js