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

jdm_javascript_dom_manipulator

v2.6.0

Published

framework javascript

Downloads

550

Readme

JDM — JavaScript DOM Manipulator

npm version CI license bundle size

Tiny, chainable DOM manipulator. Create elements, query and index children, wire events (incl. a global event bus), animate, and bind form values — all with a fluent jdm_* API on the raw DOM node.

npm install jdm_javascript_dom_manipulator
import "jdm_javascript_dom_manipulator";

JDM("<button>Click</button>", document.body)
    .jdm_addClassList(["btn", "btn-primary"])
    .jdm_onClick(() => console.log("clicked"));
  • Docs: full API reference below (generated from JSDoc).
  • Changelog: CHANGELOG.md
  • Contributing: CONTRIBUTING.md — note the strict backwards-compatibility and deprecation policy.
  • Security: SECURITY.md

API Reference

Jdm

Classe Jdm che fornisce un framework per la manipolazione del DOM. Permette di creare un elemento DOM, aggiungerlo a un genitore, assegnargli delle classi e manipolarlo in modo ricorsivo, se richiesto. I metodi della classe sono concatenabili per facilitare le operazioni sul DOM.

INSTALLAZIONE:

NPM

npm install jdm_javascript_dom_manipulator

Esempio di utilizzo classico (da inserire prima degli script che usano JDM):

<script src="./dist/jdm.js"></script>

Esempio di utilizzo di un modulo ES6 (NB: usa jdm.es.js):

import './dist/jdm.es.js';

USO

JDM('div', container, ['fooClass','barClass'])

COMPARAZIONE:

jQuery:

const $div = $('<div>', { class: 'foo bar' });
const $ul = $('<ul>');
const $li1 = $('<li>').text('Elemento 1');
const $li2 = $('<li>').text('Elemento 2');
const $li3 = $('<li>').text('Elemento 3');
const $li4 = $('<li>').text('Elemento 4');
const $li5 = $('<li>').text('Elemento 5');
$ul.append($li1, $li2, $li3, $li4, $li5);
$div.append($ul);
$('body').append($div);

JavaScript puro:

const div = 'div';
div.classList.add('foo', 'bar');
const ul = document.createElement('ul');
const li1 = document.createElement('li');
li1.textContent = 'Elemento 1';
const li2 = document.createElement('li');
li2.textContent = 'Elemento 2';
const li3 = document.createElement('li');
li3.textContent = 'Elemento 3';
const li4 = document.createElement('li');
li4.textContent = 'Elemento 4';
const li5 = document.createElement('li');
li5.textContent = 'Elemento 5';
ul.append(li1, li2, li3, li4, li5);
div.appendChild(ul);
document.body.appendChild(div);

Jdm:

const domString = `
<div class="foo bar">
    <ul>
        <li> Elemento 1 </li>
        <li> Elemento 2 </li>
        <li> Elemento 3 </li>
        <li> Elemento 4 </li>
        <li> Elemento 5 </li>
    </ul>
</div>`;
const div = JDM(domString, document.body);

Kind: global class

new Jdm([element], [parent], [classList], [deep], [...args])

Crea una nuova istanza della classe Jdm e manipola l'elemento DOM.

Returns: Jdm - - Restituisce il nodo appena creato o manipolato.

| Param | Type | Default | Description | | --- | --- | --- | --- | | [element] | HTMLElement | null | | L'elemento DOM da manipolare. Se non specificato, verrà creato un nuovo nodo. | | [parent] | HTMLElement | null | | Il genitore dell'elemento. Se specificato, l'elemento verrà aggiunto come figlio del genitore. | | [classList] | Array.<string> | null | | Una lista di classi da aggiungere all'elemento. Se specificato, verranno aggiunte le classi