nofactor

```javascript var nofactor = require("nofactor"), nostr = nofactor.string;

npm install nofactor
52 downloads in the last day
198 downloads in the last week
542 downloads in the last month

Nofactor is a light DOM API wrapper that's supported in node.js, and in the browser (IE 6+, Chrome, Firefox, Opera, Safari). It's used for DOM creation / manipulation in paperclip.js. Alt ci Coverage Status

Example:

var nofactor = require("nofactor"),

// pick the default DOM adapter - node, or browser (thin).
nostr = nofactor.string; 

var element = nostr.createElement("div"),
element.setAttribute("id", "test");


console.log(element.toString()); //<div id="test"></div>

Custom Elements:

var nofactor = require("nofactor");
nostr = nofactor.custom(nofactor.string);

// fix toString for BR tags
nostr.registerElement("br", nofactor.string.Element.extend({
    toString: function () {
        return "<br />"
    }
}));

var element = nostr.createElement("div");
element.appendChild(nostr.createElement("br"));
console.log(element.toString()); // <div><br /></div>
npm loves you