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

dom5-js-1

v1.3.0

Published

A simple NPM(NODE JS) library that can be used for advanced JavaScript DOM minipulisation in your html content.

Readme

DOM5.js

Open in GitHub Codespaces

A simple and lightweight JavaScript library for modern DOM manipulation, inspired by jQuery.

npm version

npm version Open in GitHub Codespaces

Features

  • Lightweight: A small footprint, perfect for projects where performance matters.
  • jQuery-like API: A familiar and expressive API for DOM manipulation.
  • Chainable: All manipulation methods are chainable for clean and concise code.
  • CLI Tool: Comes with a command-line tool to initialize projects.
  • Modern: Uses modern JavaScript features and a modern build process.

Installation

You can install dom5-js-1 using npm:

npm install dom5-js-1

Usage

In the Browser (via CDN)

The easiest way to get started is by using the JSDelivr CDN. Include this script tag in your HTML:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dom5.min.js"></script>

Then you can use the dom5() function globally.

<!DOCTYPE html>
<html>
<head>
  <title>DOM5.js Example</title>
</head>
<body>
  <h1 id="title">Hello, World!</h1>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dom5.min.js"></script>
  <script>
    const title = dom5('#title');

    // Change the text of the h1 element
    title.text('Hello, DOM5.js!');

    // Add a class to the h1 element
    title.addClass('my-class');

    // Add a click event listener
    title.on('click', () => {
      title.toggleClass('highlight');
    });
  </script>
</body>
</html>

As a Module

You can also import dom5-js-1 as a module in your JavaScript projects.

import dom5 from 'dom5-js-1';

dom5('#title').text('Hello from a module!');

Command-Line Interface (CLI)

dom5-js-1 comes with a command-line interface to help you get started quickly.

To see the version:

dom5 --version

init

Initialize a new project with a sample index.html and main.js.

dom5 init my-new-project

API

The dom5() function returns a DOM5 instance. All methods that modify the DOM are chainable. Getters will return a value from the first element in the selection.

  • html(content): Sets or gets the HTML content.
  • text(content): Sets or gets the text content.
  • addClass(className): Adds a class.
  • removeClass(className): Removes a class.
  • toggleClass(className): Toggles a class.
  • on(eventName, handler): Attaches an event handler.
  • attr(name, value): Sets or gets an attribute value.
  • css(prop, value): Sets or gets a CSS property value.
  • append(content): Appends content to the end of each selected element.
  • prepend(content): Prepends content to the beginning of each selected element.
  • remove(): Removes the selected elements from the DOM.
  • val(value): Sets or gets the value of form elements.
  • each(callback): Iterates over the selected elements.

Contributing

Contributions are welcome! We have a set of guidelines to help you get started. Please see our Contributing Guide for more details on how to set up your development environment, run tests, and submit pull requests.

License

This project is licensed under the MIT License.