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

dool-dom

v0.3.1

Published

> Dool-DOM is a basic implementation of DOM manipulation lib.

Readme

Dool-DOM inspired by Dool

Dool-DOM is a basic implementation of DOM manipulation lib.

Intro

With Element and RenderDOM offered by Dool-DOM, you can easily manipulate your DOM structure with pure js.

Dool-DOM has similar api like React, but Dool-DOM is more light and focus on writing HTML in js.

Start up

Install

$ npm install --save dool-dom
// or
$ yarn add dool-dom

Notice

If you'd like to use Dool-DOM with jsx, make sure you have installed babel, babel-plugin-syntax-jsx, babel-plugin-syntax-jsx, and config them in a right way:

# install babel
$ npm install babel-core babel-plugin-syntax-jsx babel-plugin-transform-react-jsx --save-dev 

babel-plugin-syntax-jsx only allows Babel to parse this syntax. Use babel-plugin-transform-react-jsx to enbale babel transform your jsx codes with Dool.

Add "pragma": "Element.createElement" to your .babelrc is required.

// .babelrc
{
  "plugins": [
    "syntax-jsx",
    [
      "transform-react-jsx",
      {
        "pragma": "Element.createElement"
      }
    ]
  ]
}

Usage

jsx syntax is supported in this lib, and you can also use Element.createElement to create virtual DOM and render it to real DOM.

Basic Usage

import { Element, RenderDOM } from 'dool-dom';

const app = Element.createElement('div', {
  id: 'app',
  Element.createElement('h1', null, 'Hello Dool-DOM!'),
  Element.createElement('blockquote', null,
    Element.createElement('code', null, 'Dool-DOM'),
    ' is a basic implementation of DOM manipulation lib.'
  ),
});

// attach app to document.body as a DOM Node
RenderDOM.render(app, document.body);

With JSX

// import statement cannot be ignored with jsx syntax
import { Element } from 'dool-dom';

const app = (
  <div id="app">
    <h1>Hello Dool-DOM!</h1>
    <blockquote>
      <code>Dool-DOM</code> is a basic implementation of DOM manipulation lib.
    </blockquote>
  </div>
);

// you can also get the DOM transformed from app Element separetly
const appDOM = RenderDOM.createDOM(app); // same as `app.render()`
appDOM.className = 'app';
document.body.appendChild(appDOM);

Example

input

import { Element } from 'dool-dom';

const root = (
  <div>
    <h1>Headline</h1>
    text
    7873632
    {undefined}
    {null}
    {[
      <div className="child">Amy</div>,
      <div className="child">Bob</div>,
      Math.random > 0.5 ? 'Cindy' : 'Dick',
      false
    ]}
    <div>Content</div>
  </div>
);

root.render();

output

<body>
  <div>
    <h1>Headline</h1>
    text
    7873632
    <!-- empty node -->
    <!-- empty node -->
    <div class="child">Amy</div>
    <div class="child">Bob</div>
    Dick
    <!-- empty node -->
    <div>Content</div>
  </div>
</body>

API

Element

Element

new Element(tagName, props, ...children): Element

Dool Element constructor.

createElement

Element.createElement(tagName, props, ...children): Element

Create Dool Element.

RenderDOM

render

render(element, mountPoint): moutPoint

Render given element to DOM Node and attached to mountPoint. For details about element, see below.

createDOM

createDOM(element): DOM Node

Render element to real DOM node.

Acceptable Element type

| Type | Result | | ---------------- | -------------------------------- | | Element instance | Element(DOMElement) | | String | TextNode | | Number | TextNode | | Undefined | Comment(<!-- empty node -->) | | Boolean | Comment(<!-- empty node -->) | | Null | Comment(<!-- empty node -->) | | Object | TyperError | | Array | DocumentFragment | | Default | Comment(<!-- unknown node -->) |

License

MIT

Copyright (c) 2018-present, Chengchuan (Conan) Liu