1.0.0 • Published 3 years ago

@tom-s/kquery v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

kQuery

A jQuery-like capable library.

Example

You can play with kQuery here: https://codesandbox.io/s/unruffled-davinci-8mgyt

OR You can also run the example locally:

git clone git@github.com:tom-s/kQuery.git
cd kQuery
npm install
npm run start

Usage

Add the package to your dependencies

npm install --save @tom-s/kquery

Import the library in your file

import kQuery from "@tom-s/kquery"

Use the library (make sure the DOM is loaded before you run any kQuery)

kQuery('.my-selector').remove()

API documentation

See assignment.md

Test

npm run test

Publication

npm run build`
npm publish`

Technical choices

I have made the following (debattable) choices:

  • isolated collection method. Each method (get, find, etc) is isolated it its own file and doesn't require any other method. This way if a method was to to be modified/removed in the future, it wouldn't affect other methods.
  • no error handling. No try/catch here, we leave to the user the handling of errors.
  • browser compatibility is ensured with babel-env polyfills.
  • building and bundling is handled with webpack.
  • linting is done with ESLINT.

Improvements

The following improvements could be made in the future:

  • make kQuery a singleton (it currently relies on npm import caching mechanism to be a singleton)
  • implement more methods and group them into modules (core, traversing, event, aso.)
  • add end to end testing (for instance to make sure it works on all browsers)
1.0.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago