{"id":29146127,"url":"https://github.com/mathiasvr/on-hold","last_synced_at":"2025-06-30T21:10:31.536Z","repository":{"id":57314405,"uuid":"69767742","full_name":"mathiasvr/on-hold","owner":"mathiasvr","description":"Repeated events for pressing and holding down DOM elements.","archived":false,"fork":false,"pushed_at":"2018-04-07T13:17:18.000Z","size":5,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-11T23:54:41.811Z","etag":null,"topics":["event-handler","repeat"],"latest_commit_sha":null,"homepage":null,"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/mathiasvr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-01T22:42:36.000Z","updated_at":"2018-06-28T18:47:51.000Z","dependencies_parsed_at":"2022-09-20T23:21:50.441Z","dependency_job_id":null,"html_url":"https://github.com/mathiasvr/on-hold","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mathiasvr/on-hold","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathiasvr%2Fon-hold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathiasvr%2Fon-hold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathiasvr%2Fon-hold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathiasvr%2Fon-hold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathiasvr","download_url":"https://codeload.github.com/mathiasvr/on-hold/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathiasvr%2Fon-hold/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261380896,"owners_count":23149963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["event-handler","repeat"],"created_at":"2025-06-30T21:10:30.815Z","updated_at":"2025-06-30T21:10:31.503Z","avatar_url":"https://github.com/mathiasvr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# on-hold [![npm][npm-img]][npm-url] [![dependencies][dep-img]][dep-url] [![license][lic-img]][lic-url]\n\n[npm-img]: https://img.shields.io/npm/v/on-hold.svg\n[npm-url]: https://www.npmjs.com/package/on-hold\n[dep-img]: https://david-dm.org/mathiasvr/on-hold.svg\n[dep-url]: https://david-dm.org/mathiasvr/on-hold\n[lic-img]: https://img.shields.io/:license-MIT-blue.svg\n[lic-url]: https://mvr.mit-license.org\n\nRepeated events for pressing and holding down DOM elements.\n\n[View example on RequireBin](http://requirebin.com/?gist=2f7235f67e494f743ab722cc93a46fda)\n\n## install\n```\n$ npm install on-hold\n```\n\n## example\nHolding down the button will call the function repeatedly:\n\n```javascript\nvar onHold = require('on-hold')\n\nvar btn = document.createElement('button')\nbtn.textContent = 'Press and Hold'\n\nonHold(btn, function () {\n  console.log('action fired')\n})\n\ndocument.body.appendChild(btn)\n```\n\n## api\n\n### `onHold(element [, { wait: 500, interval: 200 }], action)`\n\n#### element\nDOM element to attach events to.\n\n#### options\n- `wait`: initial time in ms to hold down before repeating action.\n- `interval`: interval in ms between repeated actions after inital hold down.\n\n#### action\nEvent handler function.\n\n## license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathiasvr%2Fon-hold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathiasvr%2Fon-hold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathiasvr%2Fon-hold/lists"}