miniquery-vjs
v1.0.0
Published
A lightweight, modular JavaScript utility library with plugin support.
Downloads
3
Maintainers
Readme
MiniQuery
A lightweight, modular JavaScript utility library with plugin support.
MiniQuery provides a simple API for DOM manipulation, AJAX requests, and easy extensibility through plugins — all in a compact, dependency-free package.
Features
- Easy DOM selection and manipulation
- Simple event handling
- AJAX helper methods (
GET,POST) - Plugin architecture for extensibility
- UMD build for CDN usage and ES/CJS builds for modern workflows
- Small and performant
Installation
Via npm
npm install miniquery
Then import in your project:
import $ from 'miniquery';
// Example usage: $('#myDiv').text('Hello MiniQuery!');
Via CDN
Usage Examples
Core API
const box = $('#demoBox'); box.text('Hello World!'); box.on('click', () => alert('Clicked!')); box.fadeOut(); box.fadeIn();
AJAX Request
$.get('https://jsonplaceholder.typicode.com/users/1') .then(data => console.log(data));
Plugins
Define and use plugins easily:
$.plugin('rainbow', function() { const colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']; return this.each((el, i) => { el.style.color = colors[i % colors.length]; }); });
$('#myText').rainbow();
API Reference
Full documentation coming soon.
$() - Select elements, returns a MiniQuery instance
.text(str) - Get/set text content
.on(event, handler) - Add event listener
.fadeIn(), .fadeOut() - Animate element visibility
.get(url) - Perform a GET AJAX request, returns a Promise
.plugin(name, fn) - Register a plugin method
Development Clone the repo, install dependencies and build:
npm install npm run build
License MIT © Corey Adam
