DoMini ·
A minimalistic HTML document manipulation and traversal tool. Syntactically indentical to jQuery, but much smaller with only the essential features.
Check out the documentation for all the features.
Use npm or yarn to install DoMini with a single command
# with npm
npm i domini --save-dev
# with yarn
yarn add domini
Complete library:
import DoMini from domini;
DoMini(function($){
//.. do your thing
});
Core and optional modules:
import "domini/dist/domini-core";
import "domini/dist/domini-animate";
import "domini/dist/domini-highlight";
import "domini/dist/domini-serialize";
import "domini/dist/domini-viewport";
import "domini/dist/domini-xhttp";
DoMini(function($){
//.. do your thing
});
If you prefer a build, use the CDN version (all features)
<script src="https://unpkg.com/domini@latest/dist/domini.js"></script>
..or individually (core + modules):
<script src="https://unpkg.com/domini@latest/dist/domini-core.js"></script>
// You can optionally load more modules after the core if you need them:
<script src="https://unpkg.com/domini@latest/dist/domini-animate.js"></script>
<script src="https://unpkg.com/domini@latest/dist/domini-highlight.js"></script>
<script src="https://unpkg.com/domini@latest/dist/domini-serialize.js"></script>
<script src="https://unpkg.com/domini@latest/dist/domini-xhttp.js"></script>
DoMini loads itself to the DoMini
variable in the global namespace.
// Similarly to jQuery
DoMini('#selector').text('Hi!');
// If you prefer $
const $ = DoMini;
$('#selector').text('Hi!');
// Or much better in a scope
(function($){
$('#selector').text('Hi!');
})(DoMini);
// Fires on DOMContentLoaded or immediately if DOMContentLoaded was fired
DoMini(function($){
$('#selector').text('Hi!');
});