{"_id":"@afoot/timed-press","_rev":"4-97a46aa5f782ada97f94b5e4d71f9f6f","name":"@afoot/timed-press","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.1":{"name":"@afoot/timed-press","version":"0.1.1","keywords":["module","typescript"],"author":{"url":"https://www.niftinessafoot.com","name":"Matthew Smith","email":"code@niftinessafoot.com"},"license":"MIT","_id":"@afoot/timed-press@0.1.1","maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"dist":{"shasum":"e9f2b48277df9c336bdc219979bebd45149bd0e0","tarball":"https://registry.npmjs.org/@afoot/timed-press/-/timed-press-0.1.1.tgz","fileCount":16,"integrity":"sha512-pxMHKM9KdH70fvcEEac3ZSQx/bVcjNqaPFvN08OPI6ASmd1mK6U/HaUi9n6JUwRqiTKev4W3EW0mNux8PAebUQ==","signatures":[{"sig":"MEUCIQCwc+SSCKprtAEjnBbCsk6KmS39bfQEQEtTgL4vwKslmAIgLuMeI53emyfDBrTTbLVxig2VWWNuk3vBZeEENXcNtkA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43702},"main":"dist/umd/index.js","type":"module","entry":"index.ts","types":"dist/types/index.d.ts","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","default":"./dist/umd/index.js","require":"./dist/umd/index.js"},"./legacy":"./dist/umd/legacy.js","./standalone":{"types":"./dist/types/index.d.ts","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js","require":"./dist/umd/standalone.js"}},"gitHead":"8ff267aeb4ffcffbd27c3386ed5a733781b2a8a0","scripts":{"docs":"typedoc","test":"jest","build":"rollup -c rollup.config.js -i src/index.ts","clean":"rm -rf dist/*","types":"tsc","watch":"nodemon --exec \"npm run build:dev\" --watch src/ -e ts,js","prepack":"npm run build:prod && npm run prep:umd","prebuild":"npm run clean","prep:umd":"node ./lib/init-umd-config.js","build:dev":"rollup -c rollup.config.dev.js -i src/index.ts","build:prod":"npm run build && npm run types","test:coverage":"jest --coverage"},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"repository":{"url":"https://github.com/niftinessafoot/","type":"git"},"_npmVersion":"9.8.0","description":"Get the length of time a DOM node has been active.","directories":{},"_nodeVersion":"18.10.0","browserslist":["defaults"],"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.1","eslint":"^8.44.0","rollup":"^2.79.1","nodemon":"^3.0.1","typedoc":"^0.24.8","prettier":"^3.0.0","stylelint":"^15.10.1","@babel/cli":"^7.22.6","typescript":"^5.1.6","@babel/core":"^7.22.8","@types/jest":"^29.5.3","@babel/preset-env":"^7.22.7","eslint-plugin-tsdoc":"^0.2.17","@rollup/plugin-babel":"^6.0.3","rollup-plugin-terser":"^7.0.2","eslint-config-prettier":"^8.8.0","jest-environment-jsdom":"^29.6.1","typedoc-plugin-markdown":"^3.15.3","@babel/preset-typescript":"^7.22.5","@typescript-eslint/parser":"^6.0.0","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^10.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/timed-press_0.1.1_1689197300461_0.6295130351985267","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@afoot/timed-press","version":"0.1.2","keywords":["module","typescript"],"author":{"url":"https://www.niftinessafoot.com","name":"Matthew Smith","email":"code@niftinessafoot.com"},"license":"MIT","_id":"@afoot/timed-press@0.1.2","maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"dist":{"shasum":"bd874c346a3d5cf761783c17cf87290f928855f8","tarball":"https://registry.npmjs.org/@afoot/timed-press/-/timed-press-0.1.2.tgz","fileCount":16,"integrity":"sha512-1VLNVSGCGc9WRfrTjs/KYH4SV+HveK2JCQhRS6mfnr+k6nMqHzhqlgB6X2LSbZwwf0eb4uMRHByDN8PfEEe7KQ==","signatures":[{"sig":"MEYCIQDcTolAmjdtTgCMwBdW37DM3vSv1OWzL6cjR0dOIxPiwwIhAPSM096F8svYiVBeuvGHlJC5VG+tINaLpkJmiJoaWa2D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43702},"main":"dist/umd/index.js","type":"module","entry":"index.ts","types":"dist/types/index.d.ts","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","default":"./dist/umd/index.js","require":"./dist/umd/index.js"},"./legacy":"./dist/umd/legacy.js","./standalone":{"types":"./dist/types/index.d.ts","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js","require":"./dist/umd/standalone.js"}},"gitHead":"b5ab3be0fe88acd0b85534f88068ad81c3213e4e","scripts":{"docs":"typedoc","test":"jest","build":"rollup -c rollup.config.js -i src/index.ts","clean":"rm -rf dist/*","types":"tsc","watch":"nodemon --exec \"npm run build:dev\" --watch src/ -e ts,js","prepack":"npm run build:prod && npm run prep:umd","prebuild":"npm run clean","prep:umd":"node ./lib/init-umd-config.js","build:dev":"rollup -c rollup.config.dev.js -i src/index.ts","build:prod":"npm run build && npm run types","test:coverage":"jest --coverage"},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"repository":{"url":"https://github.com/niftinessafoot/","type":"git"},"_npmVersion":"9.8.0","description":"Get the length of time a DOM node has been active.","directories":{},"_nodeVersion":"18.10.0","browserslist":["defaults"],"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.1","eslint":"^8.44.0","rollup":"^2.79.1","nodemon":"^3.0.1","typedoc":"^0.24.8","prettier":"^3.0.0","stylelint":"^15.10.1","@babel/cli":"^7.22.6","typescript":"^5.1.6","@babel/core":"^7.22.8","@types/jest":"^29.5.3","@babel/preset-env":"^7.22.7","eslint-plugin-tsdoc":"^0.2.17","@rollup/plugin-babel":"^6.0.3","rollup-plugin-terser":"^7.0.2","eslint-config-prettier":"^8.8.0","jest-environment-jsdom":"^29.6.1","typedoc-plugin-markdown":"^3.15.3","@babel/preset-typescript":"^7.22.5","@typescript-eslint/parser":"^6.0.0","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^10.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/timed-press_0.1.2_1689197641734_0.3367590187008902","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@afoot/timed-press","version":"0.1.3","keywords":["module","typescript"],"author":{"url":"https://www.niftinessafoot.com","name":"Matthew Smith","email":"code@niftinessafoot.com"},"license":"MIT","_id":"@afoot/timed-press@0.1.3","maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"dist":{"shasum":"0c6a0884555cab43c63c5e4edcd2bf01ee50bb46","tarball":"https://registry.npmjs.org/@afoot/timed-press/-/timed-press-0.1.3.tgz","fileCount":16,"integrity":"sha512-DP4SjY7AMjJ6fphMfPl5Gx0FiV5B/U0KkjDh2801wnHd14Zvhnm5SUmVtVPFWbTU28PUO1ubiROQa54+B/L4mQ==","signatures":[{"sig":"MEUCIQC8M0n8Cw3g0qxm+sEKjsKV6tg8+yL4k1/B+eC7CK3vzQIgAv7S0WlmLOaoI0KQ0rfv/LBb9ZunqZfmc7dUC+3N04A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43702},"main":"dist/umd/index.js","type":"module","entry":"index.ts","types":"dist/types/index.d.ts","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","default":"./dist/umd/index.js","require":"./dist/umd/index.js"},"./legacy":"./dist/umd/legacy.js","./standalone":{"types":"./dist/types/index.d.ts","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js","require":"./dist/umd/standalone.js"}},"gitHead":"122a891d09f5358c648f2d8da1a8f28c002cf42a","scripts":{"docs":"typedoc","test":"jest","build":"rollup -c rollup.config.js -i src/index.ts","clean":"rm -rf dist/*","types":"tsc","watch":"nodemon --exec \"npm run build:dev\" --watch src/ -e ts,js","prepack":"npm run build:prod && npm run prep:umd","prebuild":"npm run clean","prep:umd":"node ./lib/init-umd-config.js","build:dev":"rollup -c rollup.config.dev.js -i src/index.ts","build:prod":"npm run build && npm run types","test:coverage":"jest --coverage"},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"repository":{"url":"https://github.com/niftinessafoot/","type":"git"},"_npmVersion":"9.5.1","description":"Get the length of time a DOM node has been active.","directories":{},"_nodeVersion":"18.16.1","browserslist":["defaults"],"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.1","eslint":"^8.44.0","rollup":"^2.79.1","nodemon":"^3.0.1","typedoc":"^0.24.8","prettier":"^3.0.0","stylelint":"^15.10.1","@babel/cli":"^7.22.6","typescript":"^5.1.6","@babel/core":"^7.22.8","@types/jest":"^29.5.3","@babel/preset-env":"^7.22.7","eslint-plugin-tsdoc":"^0.2.17","@rollup/plugin-babel":"^6.0.3","rollup-plugin-terser":"^7.0.2","eslint-config-prettier":"^8.8.0","jest-environment-jsdom":"^29.6.1","typedoc-plugin-markdown":"^3.15.3","@babel/preset-typescript":"^7.22.5","@typescript-eslint/parser":"^6.0.0","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^10.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/timed-press_0.1.3_1689199405224_0.30615772588901846","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"@afoot/timed-press","version":"0.1.4","keywords":["module","typescript","DOM","events"],"author":{"url":"https://www.niftinessafoot.com","name":"Matthew Smith","email":"code@niftinessafoot.com"},"license":"MIT","_id":"@afoot/timed-press@0.1.4","maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"homepage":"https://github.com/niftinessafoot/timed-press","bugs":{"url":"https://github.com/niftinessafoot/timed-press/issues"},"dist":{"shasum":"9d25ef4079afd1b6d8d31abe75e01eff6fab7d58","tarball":"https://registry.npmjs.org/@afoot/timed-press/-/timed-press-0.1.4.tgz","fileCount":16,"integrity":"sha512-/UW6JBP+X16j99uqQonK1T1uwXAUd7F/1sR4hUwp9TQ77ASt/RSNUvOSyGel2iaxFrnC83ezWXKsEezBAq2n/Q==","signatures":[{"sig":"MEYCIQCPyfafIU95XVp7u8tbHZTmB6ivvIBcGCDv3/Jz1w1F8QIhAO2NxKVCgAl0AAhQTbrnf36MyoBJ2DUvt0K3liOMppos","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43867},"main":"dist/umd/index.js","type":"module","entry":"index.ts","types":"dist/types/index.d.ts","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","default":"./dist/umd/index.js","require":"./dist/umd/index.js"},"./legacy":"./dist/umd/legacy.js","./standalone":{"types":"./dist/types/index.d.ts","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js","require":"./dist/umd/standalone.js"}},"gitHead":"22549e457a4766d8c4721b99c549eb818153cf05","scripts":{"docs":"typedoc","test":"jest","build":"rollup -c rollup.config.js -i src/index.ts","clean":"rm -rf dist/*","types":"tsc","watch":"nodemon --exec \"npm run build:dev\" --watch src/ -e ts,js","prepack":"npm run build:prod && npm run prep:umd","prebuild":"npm run clean","prep:umd":"node ./lib/init-umd-config.js","build:dev":"rollup -c rollup.config.dev.js -i src/index.ts","build:prod":"npm run build && npm run types","test:coverage":"jest --coverage"},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"repository":{"url":"git+https://github.com/niftinessafoot/timed-press.git","type":"git"},"_npmVersion":"9.5.1","description":"Get the length of time a DOM node has been active.","directories":{},"_nodeVersion":"18.16.1","browserslist":["defaults"],"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.1","eslint":"^8.44.0","rollup":"^2.79.1","nodemon":"^3.0.1","typedoc":"^0.24.8","prettier":"^3.0.0","stylelint":"^15.10.1","@babel/cli":"^7.22.6","typescript":"^5.1.6","@babel/core":"^7.22.8","@types/jest":"^29.5.3","@babel/preset-env":"^7.22.7","eslint-plugin-tsdoc":"^0.2.17","@rollup/plugin-babel":"^6.0.3","rollup-plugin-terser":"^7.0.2","eslint-config-prettier":"^8.8.0","jest-environment-jsdom":"^29.6.1","typedoc-plugin-markdown":"^3.15.3","@babel/preset-typescript":"^7.22.5","@typescript-eslint/parser":"^6.0.0","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^10.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/timed-press_0.1.4_1689199858758_0.8740487408906239","host":"s3://npm-registry-packages"}},"0.1.5":{"name":"@afoot/timed-press","version":"0.1.5","description":"Get the length of time a DOM node has been active.","author":{"name":"Matthew Smith","email":"code@niftinessafoot.com","url":"https://www.niftinessafoot.com"},"keywords":["module","typescript","DOM","events"],"entry":"index.ts","license":"MIT","scripts":{"prebuild":"npm run clean","build":"rollup -c rollup.config.js -i src/index.ts","build:prod":"npm run build && npm run types","build:dev":"rollup -c rollup.config.dev.js -i src/index.ts","prepack":"npm run build:prod && npm run prep:umd","clean":"rm -rf dist/*","types":"tsc","test":"jest","test:coverage":"jest --coverage","docs":"typedoc","prep:umd":"node ./lib/init-umd-config.js","watch":"nodemon --exec \"npm run build:dev\" --watch src/ -e ts,js"},"browserslist":["defaults"],"homepage":"https://github.com/niftinessafoot/timed-press","bugs":{"url":"https://github.com/niftinessafoot/timed-press/issues"},"repository":{"type":"git","url":"git+https://github.com/niftinessafoot/timed-press.git"},"type":"module","types":"dist/types/index.d.ts","main":"dist/umd/index.js","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","require":"./dist/umd/index.js","import":"./dist/esm/index.js","default":"./dist/umd/index.js"},"./standalone":{"types":"./dist/types/index.d.ts","require":"./dist/umd/standalone.js","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js"},"./legacy":"./dist/umd/legacy.js"},"devDependencies":{"@babel/cli":"^7.22.6","@babel/core":"^7.22.8","@babel/preset-env":"^7.22.7","@babel/preset-typescript":"^7.22.5","@rollup/plugin-babel":"^6.0.3","@types/jest":"^29.5.3","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.44.0","eslint-config-prettier":"^8.8.0","eslint-plugin-tsdoc":"^0.2.17","jest":"^29.6.1","jest-environment-jsdom":"^29.6.1","nodemon":"^3.0.1","prettier":"^3.0.0","rollup":"^2.79.1","rollup-plugin-terser":"^7.0.2","stylelint":"^15.10.1","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^10.0.0","typedoc":"^0.24.8","typedoc-plugin-markdown":"^3.15.3","typescript":"^5.1.6"},"_id":"@afoot/timed-press@0.1.5","gitHead":"d50dd6b7ec966813dcfdecbb47bab954e3557c89","_nodeVersion":"18.20.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-s7m/Bq7R912oSLC0dqI/oE4KyKwV4592F1pkWvy7DXnWF/1yTLBrOE8eNMaCnY7qjEtlK2MUG71r/+rPAnG1Yg==","shasum":"e59c46a89b5ccacf171e6e4ee8112fd68514c3c6","tarball":"https://registry.npmjs.org/@afoot/timed-press/-/timed-press-0.1.5.tgz","fileCount":16,"unpackedSize":43716,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCqUQxDNwxH7EpMGMhxQPugjSy2zbfB+y1YsNUC4zLY4gIgd/B0b+nIXa+bLFLwF1u5KRC5OJqYo6HngRuhltOhYhI="}]},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"directories":{},"maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/timed-press_0.1.5_1738350834852_0.02444172439267467"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-12T21:28:20.322Z","modified":"2025-01-31T19:13:55.264Z","0.1.1":"2023-07-12T21:28:20.653Z","0.1.2":"2023-07-12T21:34:01.928Z","0.1.3":"2023-07-12T22:03:25.425Z","0.1.4":"2023-07-12T22:10:58.916Z","0.1.5":"2025-01-31T19:13:55.049Z"},"bugs":{"url":"https://github.com/niftinessafoot/timed-press/issues"},"author":{"name":"Matthew Smith","email":"code@niftinessafoot.com","url":"https://www.niftinessafoot.com"},"license":"MIT","homepage":"https://github.com/niftinessafoot/timed-press","keywords":["module","typescript","DOM","events"],"repository":{"type":"git","url":"git+https://github.com/niftinessafoot/timed-press.git"},"description":"Get the length of time a DOM node has been active.","maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"readme":"# timed-press\n\nKeep an active timer of how long a DOM element has been pressed.\n\nFires a provided callback with the ongoing duration at a specified rate and fires start/stop events.\n\n## usage\n\nInitializes with a factory, taking two parameters, a `callback` method, fired at each interval and a `rate` integer, the frequency, in milliseconds, the intervals should be run at. Defaults to 10ms.\n\n### initializing\n\n```js\nconst callback = (evt, payload) => {\n  //payload is an object with a single property: `duration`\n  console.log(payload.duration);\n};\nconst rate = 16;\nconst eventListener = timedPress({ callback, rate }); // Returns an event listener callback.\n\nelement.addEventlistener('mousedown', eventListener);\nelement.addEventlistener('mouseup', eventListener);\n```\n\n### helper event methods\n\nThe returned event listener has two functions bound as properties: `registerEvents` and `removeEvents`, managing the default events to make timedPress run.\n\n```js\nconst callback = (evt, payload) => {};\n\nconst eventListener = timedPress({ callback });\n\n// Sets the default event listeners.\neventListener.registerEvents(element);\n\n// Removes the default event listeners.\neventListener.removeEvents(element);\n```\n\n### start/stop events\n\nIn addition to the callback firing, timedPress dispatches a start event `pressStart` and an end event `pressEnd`. `pressEnd` carries the total time as a `duration` property on the event.\n\n```js\nelement.addEventListener('pressStart', (evt) => {});\n\nelement.addEventListener('pressEnd', (evt) => {\n  const { duration } = evt; // Total time pressed.\n  console.log(duration);\n});\n```\n\n## license\n\n[MIT](./LICENSE) © [Matthew Smith](http://www.niftinessafoot.com)\n\n## made with ❤️ and ☕️ by\n\n![Niftiness Afoot!](https://gist.githubusercontent.com/niftinessafoot/2dba588395cb557293d5f09aebcd2ab0/raw/770293c76bead4f0986ff959f3ea8880017d92c0/bot.svg?sanitize=true) [Matthew Smith](https://github.com/niftinessafoot)\n","readmeFilename":"README.md"}