@dhaya/kquery

A simplified jQuery-like capable library

Usage no npm install needed!

<script type="module">
  import dhayaKquery from 'https://cdn.skypack.dev/@dhaya/kquery';
</script>

README

kQuery

This repository contains the code for kQuery, a simplified jQuery-like capable library.

Installation

kQuery can be used either in your favorite framework or directly in the browser.

NPM / Yarn

First install the package from NPM / Yarn:

npm install @dhaya/kquery # or yarn add @dhaya/kquery

Then import kQuery in your code like this:

import kQuery from '@dhaya/kquery'

unpkg

You can either get access to kQuery globally, or in a script module (on modern browsers):

→ Global access

<script src="https://unpkg.com/@dhaya/kquery/dist/kquery.umd.js"></script>

→ Module

<script type="module">
  import kQuery from 'https://unpkg.com/@dhaya/kquery/dist/kquery.module.js'
</script>

Usage

kQuery provides a simple jQuery-like interface to help manipulate DOM elements. A basic example is as follows:

kQuery('h2')
    .find('strong')
    .style({ color: 'white', backgroundColor: '#333' })

This will find all <strong> elements in <h2> headings, and change their style according to the specified parameters.

Other methods are available. You can find them in the API reference.

Browser compatibility

kQuery works in all modern browsers and Internet Explorer ≥ 11.

Development

This project follows a few conventions and provides a set of tools to help developers get started quickly. Please check CONTRIBUTING.md for important information regarding contribution guidelines.