helpers-kj
v1.0.1
Published
Modern Vanilla TypeScript DOM utility library inspired by jQuery.
Downloads
33
Readme
HelpersKJ 🚀
A premium, high-performance, and native TypeScript DOM manipulation library. Inspired by the simplicity of jQuery but built with modern Vanilla JS standards. HelpersKJ is designed to be lightweight, typed, and dependency-free.
✨ Features
- 🚀 Lightning Fast: No overhead, just native DOM manipulation.
- 📦 Zero Dependencies: Pure Vanilla TypeScript.
- 🛡️ Type Safe: Full IntelliSense support with auto-generated declaration files.
- 🌐 Dual Distribution: Ships with both ES Modules (ESM) and UMD (for CDN/Unpkg).
- 🧪 Rock Solid: 100% test coverage on core utilities using Vitest & JSDOM.
📦 Installation
npm install helpers-kjOr use it via CDN:
<script src="https://unpkg.com/helpers-kj/dist/helpers-kj.umd.js"></script>🛠️ Quick Start
The kj() Factory
The entry point of the library is the kj() function. It accepts selectors, HTMLElement, or NodeList.
import { kj } from 'helpers-kj';
// Apply a premium shadow effect
kj('.card').shadow('rgba(0,0,0,0.1)');
// Chainable actions
kj('button')
.visibility(true)
.disabled(false);Form Validation
Built-in helpers for common validation patterns:
// Auto-uppercase inputs as the user types
kj('#username').uppercase();
// Validate empty field with error message
kj('#email').emptyField('#email-error');
// Secure password validation (Uppercase + Lowercase + Number)
kj('#password').securePassword('#pass-error');Advanced Utilities
Standalone functions for daily tasks:
import { randomNumber, getLocalTime, ajax } from 'helpers-kj';
const code = randomNumber(1000, 9999);
console.log(`Your time is: ${getLocalTime()}`);
// Clean AJAX requests
ajax('https://api.example.com/data', (data) => {
console.log('Received:', data);
}, { key: 'value' });🧪 Development & Testing
We take quality seriously. Our test suite ensures every helper works as expected across environments.
# Install dependencies
npm install
# Run the test suite
npm test
# Build for production
npm run build👤 Author
Armando Rojas
- GitHub: @rojasarmando
Refactored from a jQuery legacy project into a modern TS powerhouse.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
