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

onejs

v1.1.69

Published

[![Build Status](https://travis-ci.org/OneJSToolkit/onejs.png?branch=master)](https://travis-ci.org/OneJSToolkit/onejs) [![Coverage Status](https://coveralls.io/repos/OneJSToolkit/onejs/badge.png)](https://coveralls.io/r/OneJSToolkit/onejs)

Readme

The OneJS Toolkit helps you build reuseable web views.

Build Status Coverage Status

Visit the wiki documentation to get started working with OneJS!

Don't think of it as "yet another JavaScript framework." It's a small set of classes/interfaces that provide a common foundation for producing reusable control libraries that can be bundled and distributed, while minimizing impact on file size.

You only load what you need. Everything is modular and is required using RequireJS. If you only need the View class, you only bundle that with your code. If you use repeat blocks, you include the Repeater class. If you use Selection, you include that. Grow your core only as big as you need it to be. A barebones reusable web view, merged with the common core only adds 5k to the package. No more demanding yet another framework on their site.

Start with html and css, make it reusable. Creating a JavaScript view class is a matter of adding a js-type attribute on your root element and piping it through a template compiler.

Simple to understand. HTML templates compile to easily consumable JavaScript classes, so that they can be reused over and over.

The OneJS Toolkit consists of:

  • A core set of TypeScript classes, available from the github repo OneJS. You include only what you need and merge into a small redistributable, or build a site and merge a collection of controls plus classes together.
  • A template compiler that can validate your html and binding correctness, and output a JavaScript or TypeScript class which can be instantiated and rendered. Available as a gulp plugin.
  • A css to js converter that converts css into a JavaScript module which can be bundled, loaded on demand, and remapped for localization purposes.

How it works

You spin up a new auto generated project. This is as easy as typing "yo onejs".

You write View templates. The templates are HTML and have bindings similar to what you might expect in many templating frameworks. For example, here's a toggle button view which binds an "isToggled" state to light up a css class:

<button class="ToggleButton"
    js-type="ToggleButton"
    js-bind="value:value, className.isToggled:isToggled"
    js-event="click:$toggle('isToggled')" >
</button>

Behind the scenes, the template compiler can compile this down into an AMD-ready typescript class that we can render programatically:

import View = require('../onejs/View');
import DomUtils = require('../onejs/DomUtils');

class ToggleButton extends View {
    viewName = 'ToggleButton';

    onRender(): HTMLElement {
        var _this = this;
        var bindings = _this._bindings;

        return (_this.element = DomUtils.ce("button", ["class","ToggleButton"], [], bindings[0]));
    }

    // ... plus annotations on the bindings.
}

export = ToggleButton;

You can make other views that include the toggle button:

<div js-type="RootApp">
    <toggle-button js-init="value: 'click me', isToggled: true"></toggle-button>
</div>

...and all imports, rendered nesting, observing, and data management will be generated for you.