DailyJS

Small and Reusable Browser Modules: npm-dom

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

libraries dom modules npm

Small and Reusable Browser Modules: npm-dom

Posted by Alex R. Young on .
Featured

libraries dom modules npm

Small and Reusable Browser Modules: npm-dom

Posted by Alex R. Young on .

npm-dom (GitHub: npm-dom) by Azer Koçulu, Damon Oehlman, Max Ogden, Jake Verbaten, and Tim Oxley is a GitHub organisation that publishes DOM-related modules through npm.

So far there are small modules like new-element (https://github.com/npm-dom/new-element) and siblings (https://github.com/npm-dom/siblings), but also larger modules like domquery (https://github.com/npm-dom/domquery).

There are quite a few modules already. If you work with Browserify then you might like the way these modules can be consumed. As an example, take a look at class-list:

var elem = someElement;  
var ClassList = require('class-list');  
var cl = ClassList(elem);

cl.add('foo');  
cl.remove('bar');  
cl.toggle('baz');  

Azer was inspired to create another organisation called npm-flickr, which is a set of Flickr-related libraries.