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

silicagel

v1.1.2

Published

Lightweight and high performance responsive Library

Readme

Silicagel

Introduction:

    轻便,高性能的响应式库(压缩版仅3kb),可进行双向绑定,数据侦听和插值模板解析
    Lightweight, high-performance responsive Library (compressed version only 3KB),
    which provide two-way data binding, data monitoring and can parse interpolation template syntax.

Version: 1.1.2

Compatibility

    不支持IE11,浏览器需要原生支持Proxy
    IE11 not supported,browser needs native Proxy support.

Installation

npm

npm install silicagel

<script>

<!--直接引入dist文件下的silicagel.js,生产环境可以引入体积更小的silicagel.min.js-->
<script src="./dist/silicagel.js"></script>
<!--生产环境-->
<script src="./dist/silicagel.min.js"></script>

Usage

插值模板解析

<!--HTML example-->
<body>
  <h1>{{title}}</h1>
  <p>description: {{content.description}}</p>
  <p>wordNumber: {{content.wordNumber}}</p>
  <p>your comment: {{comment}}</p>
  <!--the 'bind' attribute will enable two-way data binding-->
  <!--
    If the input box changes, the data will be changed automatically. 
    The data changes will also be displayed in the current view automatically
  -->
  <input type="text" bind="comment">
</body>
import Silicagel from "silicagel"
// or 
// const Silicagel = require("silicagel")

const node = document.body

let data = {
  title: "🌸Silicagel",
  content: {
    description: "Lightweight and high performance responsive Library",
    wordNumber: 500,
  },
  comment: "nice"
}
//render函数会将传入的元素节点内所有插值模板(譬如{{content.wordNumber}})转换成data中的数据
//The render method converts all the interpolation templates (such as {{content. Wordnumber}})
//in the passed element node to corresponding content in the passed data
//render函数会返回通过Proxy代理后的对象
//The render method returns a Proxy instance(same as observe method)
//经过代理后的data对象内的变化会立即反应在DOM中
//Changes in the Proxy instance will immediately reflected in the DOM
data = Silicagel.render(node, data)

数据监听

import Silicagel from "silicagel"

let data = {
  msg: {
    id: 1,
    date: "2020/04/23",
  }
}
//observe函数返回经过Proxy代理后的函数,且提供watch方法监听数据变化
//The observe method returns a Proxy instance, and provides the watch method to listen for data changes
data = Silicagel.observe(data)

data.watch("msg.id", (newVal, oldVal) => {
  //do something
})

//watch函数的第一个参数也可以是一个函数,它会监听函数内部所有依赖的变化。这在监听数组变化时很有用
//The first parameter for the watch method can also be a function, 
//which listens for changes in all dependencies within the function.
//This is useful when listening for array changes
function combine(){
  return `id:${data.msg.id},date:${data.msg.date}`
}

data.watch(combine, (newVal, oldVal) => {
  //do something
})

History:

Date: 2020/04/24
    Silicagel v1.1.2
        Console print code removed
Date: 2020/04/24
    Silicagel v1.1.0
        new feature: two-way data binding
Date: 2020/04/23
    Silicagel v1.0.2
        Improved API error handling
Date: 2020/04/22
    Release Silicagel v1.0.0