
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
$.ajax
, $.animate
, and $.Deferred
).npm install domtastic
import $ from 'domtastic';
npm install domtastic
var $ = require('domtastic');
bower install domtastic
requirejs.config({
baseUrl: 'bower_components',
packages: [{
name: 'domtastic',
main: 'domtastic'
}]
});
require(['domtastic'], function($) {
$('.earth').addClass('evergreen').on('sunrise', '.people', awake);
});
<script src="//cdn.jsdelivr.net/npm/domtastic"></script>
$('.planet').addClass('evergreen').on('sunrise', '.grass', grow);
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.
every
filter
forEach (alias: each)
indexOf
map
pop
push
reduce
reduceRight
reverse
shift
some
unshift
css
after
append
before
clone
prepend
attr
removeAttr
addClass
hasClass
removeClass
toggleClass
contains
data
prop
appendTo
empty
remove
replaceWith
text
val
html
on (alias: bind)
off (alias: unbind)
one
ready
trigger
triggerHandler
noConflict
$
find
matches
closest
children
concat
contents
eq
first
get
parent
siblings
slice
isArray
isFunction
extend
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.
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
.
Run the benchmark suite to compare the performance of various methods of jQuery, Zepto and DOMtastic (tl/dr; it's fast!).
You can build a custom bundle that excludes specific modules that you don't need:
git clone git@github.com: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.
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
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.
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.
Many thanks to these sources of inspiration:
Thanks to the jsDelivr Open Source CDN for hosting DOMtastic.
Thanks to BrowserStack for their real device cloud.
FAQs
Small, fast, and modular DOM and event library for modern browsers.
We found that domtastic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.