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

pat2

v1.0.1

Published

a lightweight directive template

Readme

pat

pat是一个轻量级的指令型模板解决方案。具备局部刷新,双向绑定,指令扩展,filter过滤等功能。

如果你用过angular或者vue应该对指令(directive)这个概念不会陌生,angular大而全,vue精简了一部分留下了组件,而pat在angular,react,vue的基础上,结合各自的特点专注于解决模板层面的问题。

与目前主要的框架相比,pat具有以下特点:

  • 单一职责,pat只负责解决模板问题。使用者可以单独使用,也可以跟任何其他框架结合使用。
  • 支持mustache风格的模板语法,很好的避免了指令写多了模板可读性差的问题。
  • 具有指令型框架的特点,扩展性强,功能强大,可以扩展自己的指令。同时支持filter与自定义watcher。
  • 具有virtual dom中间层,一方面加快了分析指令的速度,另一方面也为服务端渲染提供了可能。
  • 同时支持脏检测与defineproperty的数据检测机制。并且都是支持ie8的。在defineproperty模式下使用vbscript来做兼容处理。

详细文档,请见:http://purplebamboo.github.io/pat/doc/views/index.html

usage

直接使用线上地址:

压缩版本:

http://g.alicdn.com/mm/pat/latest/pat-min.js

未压缩版本:

http://g.alicdn.com/mm/pat/latest/pat.js

test

采用karma + jasmine做功能性测试,后期考虑使用nightwatch或者casper来做ui的e2e测试

npm test

build

项目使用webpack打包,在根目录执行:

npm run-script build