{"id":28340990,"url":"https://github.com/mrnko/lite-debounce-js","last_synced_at":"2026-04-25T22:34:39.753Z","repository":{"id":295040172,"uuid":"988927240","full_name":"mrnko/lite-debounce-js","owner":"mrnko","description":"A lightweight, dependency-free debounce utility for JavaScript functions. Supports both leading and trailing edge execution. Perfect for input handlers, resize events, and performance optimization in modern web apps.","archived":false,"fork":false,"pushed_at":"2025-05-23T09:56:05.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-11T08:42:58.195Z","etag":null,"topics":["css","debounce","debounce-button","debounce-input","debounced","debouncing","html","javascript","js","js-debounce","vanilla-javascript","vanilla-js"],"latest_commit_sha":null,"homepage":"https://mrnko.github.io/lite-debounce-js/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrnko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-23T09:36:56.000Z","updated_at":"2025-05-23T10:00:26.000Z","dependencies_parsed_at":"2025-05-23T10:59:30.425Z","dependency_job_id":"905257b9-b292-4a3d-b56b-7f1fd8b89e66","html_url":"https://github.com/mrnko/lite-debounce-js","commit_stats":null,"previous_names":["mrnko/lite-debounce"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrnko/lite-debounce-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrnko%2Flite-debounce-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrnko%2Flite-debounce-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrnko%2Flite-debounce-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrnko%2Flite-debounce-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrnko","download_url":"https://codeload.github.com/mrnko/lite-debounce-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrnko%2Flite-debounce-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32279658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","debounce","debounce-button","debounce-input","debounced","debouncing","html","javascript","js","js-debounce","vanilla-javascript","vanilla-js"],"created_at":"2025-05-27T03:55:08.434Z","updated_at":"2026-04-25T22:34:39.748Z","avatar_url":"https://github.com/mrnko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiteDebounce\n\n[![mrnko - lite-debounce-js](https://img.shields.io/static/v1?label=mrnko\u0026message=lite-debounce-js\u0026color=blue\u0026logo=github)](https://github.com/mrnko/lite-debounce-js \"Go to GitHub repo\")\n[![stars - lite-debounce-js](https://img.shields.io/github/stars/mrnko/lite-debounce-js?style=social)](https://github.com/mrnko/lite-debounce-js)\n[![forks - lite-debounce-js](https://img.shields.io/github/forks/mrnko/lite-debounce-js?style=social)](https://github.com/mrnko/lite-debounce-js)\n\nA lightweight, dependency-free debounce utility for JavaScript functions. Supports both leading and trailing edge execution. Perfect for input handlers, resize events, and performance optimization in modern web apps.\n\n[![npm version](https://img.shields.io/npm/v/lite-debounce-js.svg?style=flat-square)](https://www.npmjs.com/package/lite-debounce-js)\n[View Demo](https://mrnko.github.io/lite-debounce-js/demo/index.html) • [View on GitHub](https://github.com/mrnko/lite-debounce-js)\n\n---\n\n## Features\n- **Zero dependencies**\n- **ESM build**\n- **Leading/trailing edge** debounce\n- **Context (`this`) support**\n- **Tiny \u0026 fast**\n\n---\n\n## Installation\n\n```bash\nnpm install lite-debounce-js\n```\nOr simply copy the file from `dist/` into your project.\n\n---\n\n## Usage\n\n### Import\n```js\n// ESM (from npm)\nimport { LiteDebounce } from 'lite-debounce-js';\n// Or import from local build:\nimport { LiteDebounce } from './dist/lite-debounce.min.js';\n```\n\n### Basic trailing debounce (default)\n```js\nconst debouncer = new LiteDebounce(() =\u003e {\n  console.log('Debounced!');\n}, 300); // 300ms delay\n\nwindow.addEventListener('resize', debouncer.fnDebounced);\n```\n\n### Leading debounce\n```js\nconst debouncer = new LiteDebounce(() =\u003e {\n  console.log('Leading call!');\n}, 500, { leading: true });\n\nconst debouncedFn = debouncer.fnDebounced;\ndebouncedFn(); // will be called immediately\n```\n\n### With arguments and context\n```js\nconst obj = {\n  value: 42,\n  log() {\n    console.log(this.value);\n  }\n};\nconst debouncer = new LiteDebounce(obj.log, 200);\nconst debouncedFn = debouncer.fnDebounced.bind(obj);\ndebouncedFn(); // logs: 42\n```\n\n---\n\n## API\n\n### `new LiteDebounce(fn, delay = 300, options = {})`\n- `fn` — function to debounce\n- `delay` — debounce delay in ms (default: 300)\n- `options.leading` — if `true`, call on the leading edge (default: `false`)\n\n#### Instance property:\n- `.fnDebounced` — debounced function, use it in event listeners or anywhere\n\n---\n\n## Demo\n\nOpen [`demo/index.html`](./demo/index.html) in your browser (with a local server) or run the dev server:\n```bash\nnpm run dev\n```\n\n---\n\n## Testing\n\n```bash\nnpm test\n```\nTests are written with [Vitest](https://vitest.dev/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrnko%2Flite-debounce-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrnko%2Flite-debounce-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrnko%2Flite-debounce-js/lists"}