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 🙏

© 2024 – Pkg Stats / Ryan Hefner

dollardom

v0.9.3

Published

A 5k Javascript library for selecting, styling, traversing and animating DOM elements.

Downloads

3

Readme

$dom

5k Javascript library for selecting, styling, traversing and animating DOM elements.

$dom was coded by Keith Clark and was once available at http://www.keithclark.co.uk/$dom/ (no longer active).

The project is currently in maintainance mode. No new code is currently developed. However, since the library was developed with standards in mind, it's future-compatible and should work in all current browsers.

FAQ

Which version to download ?

dollardom.js is always the most up to date version. I consider that is is pretty good quality, which means that I still find bugs myself, but that I feel it can be used on real web sites or web applications. Please report any bug you find.

I'll try to keep dollardom.min.js (minified with uglifyjs) in sync but take attention to the timestamp to be sure.

If you want animation support, include either both dollardom.js and animate.js or their concatened/minified version dollardom-animate.min.js. Please note however that nowadays, you should consider doing simple animations with CSS transitions. For your more complex needs you can also have a look to SVG.

If you want try the new jQuery-like simpler chaining API, you can use dollardom-chain.min.js or dollardom-chain-animate.min.js instead. Since it is newer than the normal API, it could have some bugs. Please consider this syntax beta-quality.

A debug version is also available: dollardom-full.debug.js. Using this version during development makes you certain you use dollardom correctly, because otherwise you'll get exceptions. Please note that this version is not yet finished and some $dom functions are not checked yet.

Why ?

I used $dom in a project and wanted to fix one bug. Moreover Keith Clark stopped maintaining this code and I felt it is still useful nowadays.

I asked him where I could find the original source code (since only the minified/obfuscated code was available on his website) and he kindly sent it to me.

Why $dom ? There are lots of other very good libraries outthere

That's right. For big projects, you can use jQuery, Dojo, ExtJS, Mootools, etc. For mobile projects, there are jQuery Mobile, jqtouch, Sencha touch, Zepto.js, xui.js. But please read further.

Strong points

$dom features the following strong points:

  • it's small: 2.3 kB for the minified/gzipped version (compare with jQuery's size: 30kB)
  • it's general: it's not mobile-only or desktop-only. It's perfect for mobile-first or responsive design, which should run on a variety of very different devices.
  • it's compatible with all javascript-enabled browsers in use nowadays, even Internet Explorer 6. If you find a problem in such a browser, then it is a bug, please report it.
  • the syntax is clean. Compare:
$("<div id='myDiv' class='class1 class2'>"); // jQuery

with

    $dom.create("div#myDiv.class1.class2"); // $dom.
  • it doesn't include the features you don't need, e.g. Array iteration functions (forEach, map, reduce, etc.) or Ajax. There are perfectly good polyfills outthere.
  • Good documentation
  • Permissive BSD-like license
  • the author knows Javascript and the DOM (or I think so ;-) ).
  • there is a debugging version to help you use the library correctly.

Weak points

It has also of course some weak points, because we can't have it all:

  • it is certainly slower than alternatives like jQuery. However, on real websites, we should never have 10000 nodes. If you have, then this is not the right tool. We will never support such use cases.
  • it can't animate to relative value units like em.
  • the syntax is not jQuery-compatible, which means you have to learn a new syntax. I suggest you have a look to the $dom chaining API which is cleaner and simpler than the legacy API.

Is there an alternative ?

ender.js could be a good alternative with its modular approach. One of our goals is to integrate better with this tool.

Development notes

The build script needs uglifyjs and node.

On Debian-like systems, these could most probably be installed with the command :

aptitude install libnode-uglify

TODO

  • write more tests
  • document the chaining API
  • write more examples
  • make transform queueable
  • support attribute selector
  • add more assertion to the debug version
  • add the files to integrate with ender.