Skip to content

kokhinmaungwin/webutils-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebUtils Library

Version: 1.0.1
Author: Khin Maung Win
License: MIT

Standalone utility library for all websites.
Provides handy helper functions for DOM manipulation, cookies, localStorage, events, and more.


Features

  • DOM selectors and class management
  • Event listener helpers
  • Cookie get/set/delete
  • URL query parameters parser
  • Fetch JSON wrapper (GET)
  • String utilities: capitalize, truncate
  • Debounce and throttle functions
  • Date formatting
  • Smooth scrolling
  • LocalStorage helpers

Usage

Include in your project: CDN

<script src="https://cdn.jsdelivr.net/gh/kokhinmaungwin/webutils-library@v1.0.1/dist/webutils.js"></script>

Or import as a module (Node.js / bundler):

const WebUtils = require('./webutils');

Examples

// Select one element
const header = WebUtils.$('header');

// Add class
WebUtils.addClass(header, 'active');

// Get URL query parameters
const params = WebUtils.getQueryParams();

// Fetch JSON data
WebUtils.fetchJson('/api/data').then(data => console.log(data));

API Reference

See the source code comments for detailed API descriptions.


License

MIT © Khin Maung Win


About

A lightweight, dependency-free JavaScript utility library for all websites.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors