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

rossini

v1.0.3

Published

A micro JavaScript library for basic DOM manipulation.

Downloads

12

Readme

Rossini.js

A minimal (less than 1K minified) DOM manipulation utility.

The goal is to make the most common DOM tasks a little less verbose.

Get

npm install rossini

or

<script src="../dist/rossini.umd.js"></script>

or

<script src="https://unpkg.com/rossini@latest/dist/rossini.umd.js"></script>

Use

// module
import { que, on, el, E } from 'rossini';

// commonjs
const { que, on, el, E } = require('rossini');

// browser
const {el, on, que, E} = window.rossini;

See examples/tell.html for more usage examples

Scope

3 functions and an enum.

que(selector)

Pronounced ke as in "what?" in Spanish. It's an alias for document.querySelector

const b = que('#mybutton');

el(tagName, attributes, ...children)

This is a convenience when creating DOM elements (hence el) with the goal to save some verbosity like createElement(), setAttribute() and append(). It returns the newly created element, ready to be added to the DOM.

const br = el('hr');
const h1 = el('h1', {id: 'myhead'}, 'Hello from my Rossini!');

The children spread allow any number of elements (created with el() or not) or a string. If it's a string a text node is created and appended.

document.body.append(
  el('div', null, el('p', {id: "para"}, 'Paragraph text'))
);

document.body.append(
  el('div', null, 
    el('p', {id: "para"}, 'Paragraph text'),
    el('span', {}, 'More text'),
  ),
);
// yes, I like trailing commas

The API follows pretty closely React's createElement() which is what creates elements behind the JSX sugar.

on(elementOrSelector, eventName, callback)

This is a wrapper for addEventListener plus some extras:

  • It returns a function that contains removeEventListener so you can cleanup and tap memory leaks
  • The callback receives (in addition to the Event) also the element. This is convenient when you have nested elements and the event.target is not the element but a child
on('#myButton', 'click', console.log);
on(document, 'DOMContentLoaded', (event, element) => console.log(event, element));

E

This is an enumeration of the 3 most common event names. Goals:

  • Catch typos early, no one wants to debug why the laod event isn't firing
  • Benefit from your IDE's autocomplete
  • Typing click is a muscle memory but using pointerdown is better
  • DOMContentLoaded abbreviation
on('#myButton', E.click, console.log);
on(document, E.dcl, console.log);
on(window, E.load, console.log);

TypeScript support

Although the code is pure 100% unadulturated vanilla JavaScript, if you like TS you should be good, thanks to the magic of tsc and declaration generation. There is a rossini.d.ts under /dist

IDE autocomplete should be working too because of the JSDoc blocks present in the source.

Why the name Rossini?

I was half asleep when I thought of this micro-library and, while still in bed, I started designing the API in my head.

Gioachino Rossini, the prolific Italian opera composer, was known for his habit of finishing an aria in the morning while still in bed.