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

belling

v3.0.10

Published

a fast declarative JavaScript library

Readme

belling.js

Efficient, Concise, and Out-of-the-Box Frontend Framework

Near-native performance with built-in immutable data structures.

demo: tic-tac-toe

中文版在下方

Signal

import { state, compute, watcher } from "belling";
const a = state(0 as number);
const b = compute(() => a.v + 'px');
// comput(()=>a.v+'px', a)
const w = watcher((s) => {
  // The callback is automatically triggered when state.v or compute.v changes.
  // The compute function won't execute immediately during callback; it only executes and caches results when compute.v is accessed.
  s.v;
});
w.watch(b);
a.v = 2; // Update state and trigger the callback
  • compute(f) requires f to be a pure function (mathematical function) where outputs depend solely on inputs. This reduces code errors.
  • State updates use if (v === v) to check for value changes. For example, state([]).v.push(0) won't trigger updates because the array reference remains unchanged.
  • Watchers trigger when dependencies update, regardless of actual value changes. Compare old/new values manually if needed.

Immutable Arrays

import { makeArr, Stop } from "belling";
// Create array
const l = makeArr(0, 1, 2);
// All operations return new arrays
const l2 = l.push(0);
l2.forEach(() => {
  // Stop iteration
  return Stop;
});
  • Immutable arrays use tree structures:
    • O(logN) for insertion/deletion/lookup.
    • O(N) for traversal.
  • For large arrays, the library's immutable arrays outperform native JavaScript Arrays in modification performance.
  • This implementation demonstrates significantly better performance than immer.js and immutable.js in most scenarios.

dom

belling-dom


demo: tic-tac-toe

高效,简洁,开箱即用的前端框架。

性能接近原生,内置不可变数据结构。

信号

import { state, compute, watcher } from "belling";

const a = state(0 as number)
const b = compute(() => a.v + 'px')

const w = watcher((s) => {
 // 当state.v或compute.v改变时,会自动触发回调函数。
 // 触发回调时compute并不会真正执行,只有获取compute.v时才会真正执行且缓存结果。
 s.v;
})
w.watch(b)
a.v = 2; // 此时会触发回调函数。

compute(f),f应为纯函数,即数学中的函数。函数输入的参数是其中的所有状态,确定的输入对应唯一的输出值。这可以降低代码出错的可能性。

请注意修改state后会通过if(v==v)判断内容是否更新。 例如 state([]).v.push(0) 不会触发更新。

由于watcher不会真正运行compute,它并不知道观察的状态是否真正更新(函数不同的输入,输出可以相同),当compute所依赖的状态更新时,便会触发回调。若您需要知道某个状态是否真正更新,您可以记录旧的值并与新的值进行比较,确认状态是否真正更新。

不可变数组

import { makeArr, Stop } from "belling"

// 创建数组
const l = makeArr(0, 1, 2)
// 对数组的所有操作都会返回一个新数组
const l2 = l.push(0)

l2.forEach(() => {
  // 停止遍历
  return Stop
})

不可变数组使用树实现,插入删除和查询的时间复杂度为O(logN),遍历时间复杂度为O(N),当数组很大时,相比js原生Array,使用库中的不可变数组进行更改的性能更好。该实现在大多数场景性能明显优于immer.js与immutable.js。

浏览器渲染

belling-dom