webpro/DOMtastic is a UI-focused project on GitHub with 757 stars, written primarily in JavaScript. Small, fast, and modular DOM and event library for modern browsers.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
import $ from 'domtastic';
class MyComponent extends $.BaseClass {
progress(value) {
return this.attr('data-progress', value);
}
}
let component = new MyComponent('.my-anchor');
component.progress('ive').append('<p>enhancement</p>');
Read more in the baseClass article or the docs.
API
Array
every
filter
forEach (alias: each)
indexOf
map
pop
push
reduce
reduceRight
reverse
shift
some
unshift
CSS
css
DOM
after
append
before
clone
prepend
DOM/attr
attr
removeAttr
DOM/class
addClass
hasClass
removeClass
toggleClass
DOM/contains
contains
DOM/data
data
prop
DOM/extra
appendTo
empty
remove
replaceWith
text
val
DOM/html
html
Event
on (alias: bind)
off (alias: unbind)
one
Event/ready
ready
Event/trigger
trigger
triggerHandler
NoConflict
noConflict
Selector
$
find
matches
Selector/closest
closest
Selector/extra
children
concat
contents
eq
first
get
parent
siblings
slice
Type
isArray
isFunction
Util
extend
But it doesn't even have awesomest-method!
As mentioned in the introduction, DOMtastic doesn't feature methods for Ajax, Animation, Promise, etc. Please find your own libraries to fill in the gaps as needed. Here are just some examples:
Please note that you can extend the $.fn object, just like jQuery Plugins.
Feel free to open an issue if you feel an important method is missing.
Browser Support
Latest versions of Chrome, Firefox, Safari, Opera, Android, Chrome Mobile iOS, and Mobile Safari. Internet Explorer 10 and up. IE9 requires a polyfill for classList.
Performance
Run the benchmark suite to compare the performance of various methods of jQuery, Zepto and DOMtastic (tl/dr; it's fast!).
Custom Build
You can build a custom bundle that excludes specific modules that you don't need:
git clone [email protected]:webpro/DOMtastic.git
cd DOMtastic
npm install
npm run bundle -- --exclude=css,dom/html,event/trigger
Alternatively, you can do the opposite and include what you need:
npm run bundle -- --include=array,selector/index,dom/class
Find the output in the dist/ folder.
jQuery Compatibility
Some iterator method signatures in jQuery are different (i.e. non-standard), most notably the index before element argument in each, filter and map). However, a custom build that is compatible with jQuery can be created by using the --jquery-compat flag:
npm run bundle -- --jquery-compat
Build a custom API for your application
You can also build a custom API from the ground up. By default, DOMtastic does it for you, but you can easily do it yourself in a highly custom approach. Grab the $ function from the selector, and extend the $.fn object with methods from specific modules:
var selector = require('domtastic/commonjs/selector'),
dom = require('domtastic/commonjs/dom');
var $ = selector.$;
$.fn = {};
$.fn.append = dom.append; // Or e.g. _.extend($, dom)
$.fn.prepend = dom.prepend;
module.exports = $;
This way, you don't have the slight overhead of the UMD boilerplate in a custom bundle, and a single location/module to define the API for your application. Works great with either AMD or Browserify.
Tests
Run the hosted test suite in your browser. You can also clone this repo, and run the tests locally with jsdom (using npm test). Run npm run test:bs to run the tests in real browsers using BrowserStack.
Credits
Many thanks to these sources of inspiration:
jQuery
madrobby/zepto
remy/min.js
Knockout
inkling/Backbone.Native
Thanks to the jsDelivr Open Source CDN for hosting DOMtastic.
Thanks to BrowserStack for their real device cloud.
TopGit's metadata for webpro/DOMtastic does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
What else is in the Frontend space?
webpro/DOMtastic is tracked by TopGit under the Frontend category, alongside 7 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is webpro/DOMtastic?
webpro/DOMtastic (webpro/DOMtastic) is a JavaScript project on GitHub. From the project's own README: Small, fast, and modular DOM and event library for modern browsers.
Where can I see webpro/DOMtastic in action?
The project maintains a homepage at https://domtastic.js.org. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about webpro/DOMtastic?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/webpro/DOMtastic is the definitive source.
Why is webpro/DOMtastic categorized under Frontend?
TopGit places webpro/DOMtastic in the Frontend category based on its GitHub topics and description (tagged: "dom", "events", "jquery"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Still deciding about DOMtastic?
One click hands the question to an AI along with this page — see what it says about DOMtastic.