https://github.com/icelk/js-utils
Javascript utility functions
https://github.com/icelk/js-utils
Last synced: about 1 year ago
JSON representation
Javascript utility functions
- Host: GitHub
- URL: https://github.com/icelk/js-utils
- Owner: Icelk
- License: cc0-1.0
- Created: 2022-01-08T18:44:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-30T19:44:51.000Z (over 3 years ago)
- Last Synced: 2025-02-03T21:47:35.933Z (over 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JS utils
This is a small collection of Javascript functions I occasionally use.
Some [functions](#functions) are available in both old JS style (HTML script tag to include code),
ES modules (`import throttle from "./throttle.mjs"`) and typescript.
# License
This is licensed under CC0 - everything's under public domain.
# Functions
## [throttle.js](throttle.js)
This limits the callback of events to a user-specified duration.
Useful for making API calls from user key presses.
## [anchor.js](anchor.js)
Enables smooth scrolling when clicking on anchor links.
Also highlights the anchor, both on click and on page load, when the fragment part of the URI is a anchor on the page.
## [headerLink.js](headerLink.js)
Adds buttons to headers to get a link to the page & anchor.