@aymeric-giraudet/kquery v0.2.0
kQuery
This is a lightweight alternative to jQuery, you can find a demo right here !
Installation
There are two ways of using kQuery, either with a package manager, or with a script tag from unpkg
Package manager
You can use your favorite package manager such as npm, yarn or pnpm :
npm install @aymeric-giraudet/kquery
You can then import in your code like so :
import kQuery from "@aymeric-giraudet/kquery";
unpkg UMD global
This will make kQuery available as a UMD global.
<script src="https://unpkg.com/@aymeric-giraudet/kquery/dist/kquery.umd.js"></script>
API
You can find the whole documentation right here.
Similarly to jQuery, you use CSS selectors to initialize a collection.
You can then chain methods like so, here's an example that will apply a new background color to all elements with card
class, then remove all elements with address
tags inside of each card
. :
kQuery(".card").style({ backgroundColor: "#eee" }).find("address").remove();
Browser compatibility
The library works with all modern browsers and on IE 11.
To ensure IE 11 compatibility, it's important for contributors to check on caniuse.com for compatibility.
For older versions of browsers, you can use browserlist with your favorite bundler to target what you want, and include polyfills you might need.
Contributing
Firstly, please read and accept the code of conduct.
You can then clone the repository and install like this :
git clone https://github.com/aymeric-giraudet/kquery.git
cd kQuery
npm install
Then you can develop, write tests, and create pull requests following our templates !