... because sometimes, all you need is a snack.
- ~3.3kb! (minified, gzipped, can't even see it when it turns to the side)
- Use any selector engine. Ships with multiple builds (QSA, Qwery, Slick, Sizzle)
- Several element methods
- API to add more element methods
- Cross-browser DOMContentLoaded (domready)
- Cross-browser DOM events
- Event Delegation (with or without a selector engine)
- Publisher objects for application communication
- Cross-browser AJAX
- Shallow object merge with
- Prototypal inheritance with
- A few other utilities (only those snack uses)
Snack is very well documented. In the repository is a docs folder.
docs/index.html in your browser or visit the Snack Homepage.
Because Snack ships with several selector engines, there are submodules for each one. You'll need to first update them to build or test Snack:
From the root of the repository:
$ git submodule init $ git submodule update
$ node server.js
Building snack requires uglifyjs.
The tests do not require you to build snack.
- MooTools (c) Valerio Proietti, MIT license
- jQuery (c) John Resig, Dual license MIT or GPL Version 2
- Zepto (c) Thomas Fuchs, MIT License
- ContentLoaded (c) Diego Perini, MIT License
MIT Style license.
Copyright (c) Ryan Florence