Quantdom JS
Quantdom is a very small (about 600 bytes when ran through terser & gzipped) dom danipulation library that uuses a Jquery like syntax and supports chaining but is only comprised of the most commonly used Jquery functions.
Made for working with the dom less verbose without all the bloat from jQuery. I chose to base it off of Jquery's syntax as many developers are already familar with it and it is very concise. This library is meant to be as small as possible (without being unreadble) so when you need to directly interact with the DOM you can use this library on top of a larger framework without extra bloat that you don't need.
Why the name, QuantDOM ? Taken from Wikipedia's Quantum article, "In physics, a quantum (plural quanta) is the minimum amount of any physical entity (physical property) involved in an interaction." This fit the goal of this project in the way Quantdom is made to reduce the effort when having to deal directly with the DOM.
Optional Chaining: $('.modal').show().addClass('active').text('Modal is open!');
Getting Started
Install via NPM
- Install using npm
npm i quantdom
or with yarnyarn add quantdom
- Then import into project using
import q from 'quantdom'
or use the jQuery popularized $ as your function name. i.e.import $ from 'quantdom'
Install via CDN
-
Use latest version https://cdn.jsdelivr.net/npm/quantdom or specify a certain version https://cdn.jsdelivr.net/npm/[email protected]/dist/quantdom.min.js
<script src="https://cdn.jsdelivr.net/npm/quantdom"></script>
-
Then start using with $() ex.
$('.drop-down').attr('aria-expanded', 'true')
Try it Out!
- Fork the below playground by clicking th New Bin button and start editing!
- Go to JSBin Playground
Documentation
View generated documentation