finds.dev← search

// the find

remy/min.js

★ 1,094 · JavaScript · updated Jul 2013

Super minimal selector and event library

A 2013 micro-library (~200 bytes minified) that wraps querySelector/querySelectorAll and patches Node/NodeList with .on() and .trigger(). It's for people who wanted jQuery-like syntax without jQuery's weight, at a time when that trade-off made sense.

- Dead simple implementation — you can read and fully understand the source in 5 minutes, which is more than you can say for most DOM libraries

- Returns raw DOM nodes intentionally, so there's no wrapper object to unpeel when you need the real element

- Patches Node and NodeList directly, so document.on() works without any special-casing

- Has a test suite with delegation specs, which is more than most micro-libs from this era bothered with

- Abandoned in 2013 — the last commit is 13 years old, Travis CI badge points to a dead service, and the Flattr donate button is gone

- No way to remove event listeners — the README admits this and hand-waves it away, which will cause memory leaks in any SPA-style usage

- Patching global prototypes (Node, NodeList) is a landmine in any project sharing a DOM with third-party scripts

- The inconsistent return type ($() returns a NodeList sometimes, an Element other times depending on match count) will cause silent bugs — you have to know what you'll get before you call it

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →