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

@dorgaren/usable

v0.2.0

Published

Make the Web / DOM usable!

Readme

usable.js v0.2.0

Making the Web / DOM usable

The problem

Since Google, Apple and a few others hold the Web / DOM hostage (mainly through "WHATWG"), blocking useful evolutions while deliberately introducing dumb or egotistic changes, the whole model "evolved" into the split personality of a dystopian nightmare on one hand and being stuck in the '00s at the other.

This project is an attempt at turning (parts of) the DOM API into things both usable and consistent.

Installation, usage

First,

npm install @dorgaren/usable

then

require("@dorgaren/usable").install();

Please note that for this to work, you must absolutely load it before anything else, including lodash/underscore, jQuery, React, and Angular.

install() accepts an optional argument for the global object. If you run it in Node but have a window global for anything (else), or conversely, are using it in browser but having a global global reserved for something, you may hint at which global object to use, by choosing

require("@dorgaren/usable").install(window); // browser

or

require("@dorgaren/usable").install(global); // Node

explicitly.

Note: given the lack of native DOM support in Node, if you wish to use new DOM features, please use JSDOM as follows:

let jsDOM = require("js-dom");
require("@dorgaren/usable").install(global, { dom: jsDOM.window });

You should have similar success using an alternate DOM (like ShadowRoot, or even JSDOM) in a browser.

Please report any implementation / combination that does not work whilst you believe it should.

Not using Webpack/NPM?

In this case, I recommend that you use require.js. Download require.js and put it alongside your "site" script (here, site.js).

Replace the loading of your site script in the head with

    <script data-main="script/site" src="script/require.js"></script>

Then begin your "site" script with

requirejs([ "@dorgaren/usable" ], function(usable) { usable.install(); });

This way, anything you do with Usable will remain compatible when/if (ever) you switch to using a bundler.

Current aims

  • An EventTarget that is actually reasonable in functionality
  • DocumentFragment enhancements
  • Dynamic HTMLCollection and NodeList
  • ... (more to come)

Non-goals

There is stuff that would be great to make useful, but cannot really be touched from JS side. Some of these:

  • Useful CSS dimension units (like ch, cw for "content height", "content width", or ph/pw for "parent height, parent width", respectively)
  • ... (will add stuff here)

Do you have a basis for all this nonsense?

Surely enough, I will add details about the actual issues as I will have time, that is, by 1.0 hopefully. Please stay tuned until then. In general, however, apart from some rants, this project mainly tries to take its stance on the scientific, as opposed to the guru/religious side; so if the goals above don't tell you much, please don't bother.

Caveats

  • Performance

Please note that some implementations here may not be the most optimal approaches, either in general, or on the specific platform you use.

This will definitely evolve over time, as long as the underlying proof-of-concept is viable.

  • No support for "options" in "addEventListener"

Will follow soon (need to check the proposed inconsistencies across platforms).

FAQ

1. Why is this not in pure ES5 / ES6 / whatever syntax?

Most of the stuff that needs to be accessible for this kind of matter to work is either inaccessible or discouraged in ES6. Meanwhile, there are a lot of "syntactic sugars" that are generally useful in ES6, causing little to no ambiguity, and are supported

This should work natively in IE11 and anything from 2016 onwards.

Should you have any issues, though, just run this through some "transpiler". I tested it extensively with Buble.

2. Why slow / no minification / packaging etc?

Please consider all of this experimental before 1.0. That means that the core goals are warranted, but nothing else, neither expressed nor implied. This latter includes things like payload size or computational performance.

Note that the notion do not expect does not at all mean that they won't happen any sooner. Just do not fill the issues queue with stuff like that for the time being, please.

But please do open issues for anything extraordinary, i.e. if you find a platform that is like 10-100x slower using this than the others you tested.

3. Why CommonJS???

While this is supposed to work great in Node.js, its primary target is the browser.

Then again, to use such functionality, one needs ES5 syntax, that is, use object mangling, and the prototype approach.

In my opinion (yes, this is personal), ES module syntax looks very odd with prototype mangling.

Also, backwards compatibility is an internal requirement.

4. Node.js? There is not even native DOM support..

I suggest that you use JSDOM, as written in the example above.