Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

Β 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

πŸ› οΈ Web Dev Toolkit

A collection of useful web development utilities, snippets, and tools for frontend developers.

Built with ❀️ by AliMahmoudDev and contributors.

πŸ“¦ Utilities

Utility Description
debounce Creates a debounced version of a function that delays invocation
throttle Creates a throttled version of a function that limits invocation rate
deepClone Creates a deep clone of an object using structuredClone
formatDate Formats a date using Intl.DateTimeFormat
debounceAsync Async version of debounce
isEmpty Checks if a value is empty (null, string, array, object)
classNames Conditionally joins class names together
sleep Promise-based setTimeout wrapper
randomId Generates a random ID with optional prefix
clamp Clamps a number between min and max values
copyToClipboard Copies text to clipboard with fallback
generateGradient Generates CSS gradient strings
truncateText Truncates text to a max length with suffix
parseQueryString Parses query strings into objects
formatBytes Formats bytes into human-readable sizes
omit Creates object without specified keys
pick Creates object with only specified keys
slugify Converts text to URL-friendly slugs

πŸš€ Usage

import { debounce, throttle, formatBytes } from './src/utils';

// Debounce a search input
const debouncedSearch = debounce((query) => {
  console.log('Searching for:', query);
}, 300);

// Throttle scroll events
const throttledScroll = throttle(() => {
  console.log('Scroll position:', window.scrollY);
}, 100);

// Format file sizes
console.log(formatBytes(1024 * 1024)); // "1 MB"

🀝 Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT License - feel free to use in your projects!


⭐ If you find this useful, please consider giving it a star!

About

πŸ› οΈ A collection of useful web development utilities, snippets, and tools for frontend developers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages