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

wkit

v1.12.3

Published

A library for building fast, lightweight web components.

Downloads

73

Readme

Wkit

一个简单易用、功能完善的用于开发web components的轻量级开发库。模板解析基于lit-html二次开发

downloads version

开发文档

开发文档

我们的特色

  • @xxx=yyy 事件绑定, 可以任意节点上直接使用类似vue事件绑定的这种写法, 就可实现事件绑定。组件被移出文档时, 事件会自动销毁, 无须手动销毁。
  • @click.stop=xxx 事件绑定支持修饰符
  • :xxx=yyy, 属性绑定, 类似vue,在属性前加上:, 该属性不再使用setAttribute(), 而是直接赋值, 可满足你需要传递复杂数据结构的需求。
  • #animation={type}, 开箱即用的动画配置, 内置6种动画fade(默认), scale, bounce, micro-bounce, rotate, slide
  • ref=xxx, 类似vue的节点标识, 可方便的在mounted()之后通过 this.$refs.xxx 来访问该节点
  • 内置特色的双向绑定方法live()
  • 用内置的bind()方法来给当前组件绑定事件时, 组件移除时事件也会自动销毁,无需手动销毁。
  • 灵活的props定义

示例

// alias wkit='//jscdn.ink/wkit/latest/index.js'
import { css, html, Component } from 'wkit'

class Hello extends Component {

  static props = {
    count: {
      type: Number,
      default: 0,
      attribute: true // 是否显式表现为html属性
    },
    foo: 0, // 简写
    bar: String // 简写
  }

  // 若需要支持 scss语法, 则需要使用构建工具编译。
  // 可支持数组
  static styles = css`
    button { color: #09f; }
    span { color: #f30; }
  `

  // 支持多个
  static styles = [
    css`...`,
    css`...`
  ]

  render(){
    return html`
      <div>
        <button @click="${this.increase}">点击我</button>
      </div>
      <div>所有点击数为: <span>${this.count}</span></div>
    `
  }

  increase(){
    this.count++
  }

}

if (!customElements.get('wc-hello')) {
  customElements.define('wc-hello', Hello)
}
// 和上面的写法等价
// 如果不希望修改前缀`wc-`的话, 可以直接调用内置的reg方法注册组件即可。
Hello.reg('hello')


/* 

  <!-- 在html中,便可以直接使用 -->
  <wc-hello></wc-hello>

*/

开源协议

  • BSD 3-Clause License (Lit框架的html模板解析的源码)
  • MIT (除Lit代码之外的所有代码)