1
0
Fork
You've already forked smallQuery
0
smallQuery, like jQuery but small.
  • JavaScript 99.5%
  • HTML 0.5%
Matt Molyneaux a23509e3a5 Use strict
I'd prefer it inside the IIFE but esbuild doesn't allow that
See https://github.com/evanw/esbuild/issues/2264 
2025年05月27日 23:06:18 +01:00
spec replaceWith 2023年04月21日 20:17:12 +01:00
src First attempt at documentation 2025年05月27日 22:38:18 +01:00
.codecov.yml Prasers should be at the top level of configuration 2019年06月17日 11:51:28 +01:00
.editorconfig Editorconfig config 2019年02月15日 15:00:38 +00:00
.gitignore First attempt at documentation 2025年05月27日 22:38:18 +01:00
.jshintrc Turn smallQuery into a series of ES6 modules 2020年06月05日 18:23:05 +01:00
CHANGELOG.md Version 0.0.6 2025年05月25日 18:59:28 +01:00
demo.html First attempt at documentation 2025年05月27日 22:38:18 +01:00
jsdoc.conf First attempt at documentation 2025年05月27日 22:38:18 +01:00
karma.conf.js wrap, wrapInner, wrapAll 2021年04月11日 17:33:07 +01:00
LICENSE Initial commit 2019年02月10日 16:34:22 +00:00
package-lock.json First attempt at documentation 2025年05月27日 22:38:18 +01:00
package.json Use strict 2025年05月27日 23:06:18 +01:00
README.md Remove Github references and update deps 2024年08月10日 01:08:45 +01:00

smallQuery

A jQuery clone, except there's a bunch of stuff we don't implement. Also, where possible we don't reinvent the wheel and just use what the browser provides.

Where?

Why though?

I needed a project that would help me learn JS beyond the basics I needed for work. Reimplementing jQuery works well because:

  • I use jQuery quite a lot so I'm familiar with its API, just not it internals.
  • There are a lot of things jQuery does that I'm not interested in, so that gives me the opportunity to make something smaller and possibly faster. That should keep me interested in the project long enough for me to learn something useful from the project.
  • I can mimic jQuery's plugin architecture, allowing me to implement features piecemeal.

What's been implemented?

So far:

  • Selecting and create HTML elements
  • Basic tree traversal via find, children, siblings, parent and parents
  • Basic tree manipulation via append, prepend, before, after, wrap, wrapInner, wrapAll, and replaceWith
  • The Data API
  • The CSS API
  • Event handling
  • Cloning!

What will be implemented?

Other than what's already listed in the issue tracker, I'm fairly open to suggestions. I would like to keep this library reasonably close to jQuery in terms of API, so keep that in mind before opening an issue.

Some things I won't consider:

  • Utility functions that aren't used by smallQuery itself, e.g. implementing jQuery.grep()
  • Deprecated APIs, e.g. .andSelf()
  • Custom selectors
  • Effects and animation (do it in CSS or don't do it at all)
  • Per event type functions, e.g. .click()
  • Support for Browsers that are no longer receiving updates, e.g. Internet Explorer 8
  • AJAX. The Fetch API in your browser is far nicer.

Tests?

Test are run via Karma and code is linted via JSHint. The following scripts are defined for your convenience:

npm run test:firefox
npm run test:chrome
rpm run lint

See package.json for other commands

License?

See LICENSE