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

gaddomnit

v0.3.1

Published

Serialize the DOM into a standalone HTML file.

Readme

Gad Domnit!

Web developers, curse rendering issues no more! Reduce the number of expletives needed when dealing with bug reports by including the exact state of every HTML element in the DOM into a single, inspectable file.

Also useful for a number of other family-friendly uses, including saving any webpage into a single file.

Gad Domnit! on NPM Travis CI Build MIT Licensed

Features

Removes Dependencies All dynamic resources (<script>, <link>) are changed to prevent them from modifying the document.

| DOM | Serialized | | --- | ---------- | | <script src="main.js"></script> | <script data-originalSrc="main.js"></script> |

Computes Style The style of each element is computed and saved, ensuring that content is styled the same when opened.

| DOM | Serialized | | --- | ---------- | | <style>div {height: 2em;}</style> <div style="width: 50%"></div> | <style></style> <div style="height: 2em; width: 50%;" data-originalStyle="width: 50%;"></div> |

Extendable Domnit is written in modular, object-oriented code. The existing functionality can be easily changed, and new modifications can be added.

Domnit = require "gaddomnit"
ElementSerializer = Domnit.ElementSerializer
count = 0
class DivSerializer extends ElementSerializer
  update: ->
    super()
    this.el.addAttribute "data-count", ++count

class MySerializer extends Domnit
  divSerializer: DivSerializer

(Yes, that's a complete example.)

Demonstration

bootstrap.html A demonstration or serialization using components from the Bootstrap library.

codemirror.html A demonstration of using Domnit to debug a rendering issue when using the CodeMirror editor.

Installation

Install gaddomnit via NPM or directly from RawGit:

<script src="https://cdn.rawgit.com/rweda/gaddomnit/v0.3.1/public/domnit-universal.min.js"></script>

The universal build should work as a standalone script, via RequireJS, or via CommonJS/NPM. It bundles all of the dependencies, and should work out of the box.

Alternatively, specify -browser to only get RequireJS syntax, -node for only CommonJS, or no suffix at all to get a raw script without any loader.

Add .nolib immediately after the syntax specification to load dependencies via RequireJS/CommonJS (or browser globals if you aren't using a module loader).

Usage

// require(["domnit"], function(Domnit) {
// Domnit = require("gaddomnit");

var domnit = new Domnit({});
domnit.serialize(document.body);
// -> "<body style='display: block'>...</body>"

After loading Domnit, create a new Domnit object, optionally passing an object with configuration options. Then call Domnit#serialize with an Element to serialize, which returns a standalone string representing the element and all it's children.

See Domnit class documentation for the full API as well as information on extending Domnit's features.