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

nite-typescript

v1.0.9

Published

An expressive UI component library offering dynamic theming, custom widgets, and smooth user interactions for modern web development.

Downloads

558

Readme

Nite

The official Nite package – a lightweight, reactive JavaScript utility for building dynamic user interfaces.

For full documentation, visit: Nite Documentation


Features

  • Reactive State Management: Track changes to variables and automatically update the DOM.
  • Simple DOM Utilities: Create nodes, update text, and handle events without external frameworks.
  • Lightweight and Fast: Minimal overhead for small projects or prototyping.

Installation

npm install nite-typescript
Or via CDN:


// Initialize a reactive variable
const [count, setCount, observe] = Watch(0);

// Create a button element
const button = createNode('button');
Text(button, `Count ${count()}`);
SetChild(document.body,button);

// Automatically update the button text whenever `count` changes
observe(() => {
    Text(button, `Count ${count()}`);
});

// Increment count when button is clicked
HandleEvent(button, 'click', () => setCount(count() + 1));
How it works:

Watch(initialValue) returns [getter, setter, observer].

getter() → gets the current value.

setter(newValue) → updates the value.

observer(callback) → runs the callback whenever the value changes.

createNode(tag) → creates a new DOM element of the given tag.

Text(node, string) → updates the text content of a node.

listenForEvent(node, event, callback) → adds event listeners easily.

Advanced Usage
You can use Watch for multiple reactive variables and more complex UI updates:

ts
Copy code
const [countA, setCountA, observeA] = Watch(0);
const [countB, setCountB, observeB] = Watch(10);

const display = createNode('div');
document.body.appendChild(display);

// Automatically update display when any reactive variable changes
observeA(() => Text(display, `A: ${countA()}, B: ${countB()}`));
observeB(() => Text(display, `A: ${countA()}, B: ${countB()}`));

listenForEvent(display, 'click', () => {
    setCountA(countA() + 1);
    setCountB(countB() + 2);
});
Any reactive variable change automatically updates all observers.

Perfect for counters, forms, or small dynamic components.

Why Use Nite?
Reactive without frameworks: No need for React, Vue, or Svelte.

Easy to learn: Minimal API surface.

Direct DOM access: No virtual DOM overhead.

Composable: Combine multiple reactive variables and observers for complex interactions.

Links
Documentation: http://nite-documentation.vercel.app

NPM Package: https://www.npmjs.com/package/nite-typescript

Contributing
Fork the repository.

Create a new branch: git checkout -b feature-name.

Make your changes and test.

Submit a pull request describing your changes.

FAQ
Q: Why doesn’t my DOM update automatically?
A: Make sure you’re using observe() on reactive variables created with Watch(). Only variables wrapped in Watch() are reactive.

Q: Can I use multiple reactive variables together?
A: Yes! Simply create multiple Watch() variables and use their observers. All observers will update when their respective variables change.

Q: Does Nite work with frameworks like React?
A: Nite is framework-agnostic and works best with vanilla JS or small projects. You can integrate it with frameworks, but it’s designed for direct DOM manipulation.