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

kanciljs

v0.1.0

Published

🐭 Kancil.JS β€” A fast, lightweight, and clever frontend micro-library

Readme

KancilJS 🐭⚑

A fast and lightweight frontend library for reactive components without the complexity.

"KancilJS is a minimal solution to build reactive UI without heavyweight frameworks."


✨ Features

  • πŸ”„ Reactive State Binding using {{variable}} directly in HTML
  • 🧩 Simple Component architecture (no class inheritance needed)
  • πŸ–±οΈ Event Binding with HTML attributes like @click, @input, @change, @keyup, etc.
  • πŸ’Ύ Automatic localStorage persistence using storeKey
  • πŸ” Auto re-render on state updates
  • πŸ”₯ Composable and lightweight, ideal for small to medium projects

πŸ“¦ Installation

From GitHub (not yet on npm)

npm install pinoruswana/kanciljs

Import it in your browser:

import { KancilComponent } from './node_modules/kanciljs/src/kancil.js';

πŸš€ Usage Example

1. Initialize Component

<div id="app">
    <h1>Hello {{name}}</h1>
    <input type="text" @input="name" />
    <button @click="count++">Click {{count}}</button>
</div>

<script type="module">
    import { KancilComponent } from './node_modules/kanciljs/src/kancil.js';

    new KancilComponent({
        target: '#app',
        state: {
            name: 'Kancil Boss',
            count: 0,
        },
    });
</script>

2. Enable Persistence with storeKey

new KancilComponent({
    target: '#app',
    state: {
        name: '',
        count: 0,
    },
    storeKey: 'kancil-store',
});

State will be automatically saved and loaded from localStorage.


🧠 Reactive State

  • Bind values in HTML using {{variable}}
  • Inputs are auto-bound via @input
  • State updates (e.g. state.count++) will trigger re-render

⚑ Event Binding

Use @event="expression" directly in HTML:

| Attribute | Description | | --------- | ------------------------------------- | | @click | When clicked | | @input | On input change | | @change | On value change (select, radio, etc.) | | @keyup | On key release (supports filters) |

Example:

<input @keyup="name = $el.value" />

$el refers to the element that triggered the event.


πŸ”’ Cursor and Focus Handling

KancilJS automatically restores the cursor position and element focus after re-renders during input.


πŸ’Ύ Auto localStorage Integration

When storeKey is defined, state will persist using localStorage. No manual handling required.


πŸ§ͺ Extra Tips

  • Use $el to access the event target element inside expressions
  • Example: @input="username = $el.value"

πŸ“ Project Structure

project/
β”œβ”€ index.html
β”œβ”€ node_modules/
β”‚  └─ kanciljs/
β”‚     └─ src/kancil.js
└─ main.js

πŸ“„ License

MIT Β© 2025 Pino Ruswana


β€œKancil is not just clever – it's agile, minimal, and perfect for fast and modern development.”