{"id":17049070,"url":"https://github.com/toddself/nanodrag","last_synced_at":"2026-02-17T14:01:51.551Z","repository":{"id":57308020,"uuid":"116050735","full_name":"toddself/nanodrag","owner":"toddself","description":null,"archived":false,"fork":false,"pushed_at":"2018-01-03T22:18:34.000Z","size":41,"stargazers_count":16,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-27T03:23:11.643Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toddself.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":"2018-01-02T19:43:51.000Z","updated_at":"2023-05-30T14:03:07.000Z","dependencies_parsed_at":"2022-09-12T11:20:21.630Z","dependency_job_id":null,"html_url":"https://github.com/toddself/nanodrag","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/toddself/nanodrag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fnanodrag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fnanodrag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fnanodrag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fnanodrag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toddself","download_url":"https://codeload.github.com/toddself/nanodrag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fnanodrag/sbom","scorecard":{"id":891196,"data":{"date":"2025-08-11","repo":{"name":"github.com/toddself/nanodrag","commit":"1280c28e4e91fbcb24b00f6bc475382dd42f2d96"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T11:54:15.836Z","repository_id":57308020,"created_at":"2025-08-24T11:54:15.836Z","updated_at":"2025-08-24T11:54:15.836Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29546746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T13:00:00.370Z","status":"ssl_error","status_checked_at":"2026-02-17T12:57:14.072Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-10-14T09:53:47.831Z","updated_at":"2026-02-17T14:01:51.511Z","avatar_url":"https://github.com/toddself.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nanodrag  [![stability][0]][1]\n[![npm version][2]][3] [![build status][4]][5]\n[![downloads][6]][7] [![js-standard-style][8]][9]\n\nA small library to simplify the handling of drag events on mouse \u0026 touch devices.\n\n## Usage\n\n```js\nconst Nanodrag = require('nanodrag')\nconst div = document.createElement('div')\nconst nd = Nanodrag(div)\n\nnd.on('start', (data) =\u003e {\n  console.log('Drag started!', data)\n})\n\nnd.on('move', (data) =\u003e {\n  console.log('Dragging!', data)\n})\n\nnd.on('end', (data) =\u003e {\n  console.log('Drag finished!', data)\n})\n\nnd.close()\n```\n\n## API\n\n### Properties\n\n#### preventDefault:boolean\nIf this is set to true, it will call `event.preventDefault()` on the event\nprovided by the `touchmove` or `mousemove` event. This property only works\nif you did **not** set `{passive: true}` in the constructor.\n\nExamples:\n\nThis will attach the listener in passive mode and prevent the calling of\n`event.preventDefault` regardless of what value `Nanodrag.preventDefault` is. \n\n```js\nconst nd = new Nanodrag(element, {passive: true})\n```\n\nThis will attach the listener in active mode allowing you decide to call\n`event.preventDefault` at a later time.\n\n```js\nconst nd = new Nanodrag(element)\nnd.on('start', () =\u003e {\n  nd.preventDefault = false\n})\n```\n\n### Methods\n\n#### new Nanodrag(selector:string|element:HTMLElement, options?:object(key:any)):nanodrag\nCreate a new nanodrag instance. You can either pass in a valid selector for\n`.querySelector` or a reference to an HTML element. A nanodrag instance is also\nan instance of a [nanobus](https://github.com/choojs/nanobus) object.\n\n**options**\n* `trackingDelay`?:number - the delay (in nanoseconds) to wait before turning off\n    the tracking mode if the mouse escapes the tracked element. Default: 300\n* `passive`?:boolean - attach `touchmove` and `mousemove` as passive listeners.\n    This will prevent calling `event.preventDefault` on move events.\n\n#### nanodrag#on(event:string, listener:function)\nProvide a function to invoke when the specified event is triggered\n\n#### nanodrag#once(event:string, listener:function)\nAttach an event to invoke only once\n\n#### nanodrag#emit(event:string, data:any)\nInvoke an event with a specific payload of data\n\n#### nanodrag#removeListener(event:string, listener:function)\nRemove a specific listener\n\n#### nanodrag#removeAllListeners(event?:string)\nRemove all listeners for a given event; if no event is specified, removed all\nlisteners.\n\n#### nanodrag#close()\nRemove all listeners on the DOM as well as on the nanobus instances and stop\nreporting any move events\n\n### Events\n\n#### start\nTriggered when a touch start or mouse down event occur on the nanodrag element. \n\n**data**\n* `start`:object\n    * `x`:number - the x coordinate of the touch instrument or mouse\n    * `y`:number - the y coordinate of the touch instrument or mouse\n\n#### move\nTriggered when the mouse or touch instrument is moved after being started. For\nmouse-like devices, this means the button must be actively held down\n\n**data**\n* `start`:object\n    * `x`:number - the starting x coordinate of the touch instrument or mouse\n    * `y`:number - the starting y coordinate of the touch instrument or mouse\n* `current`:object\n    * `x`:number - the current x coordinate of the touch instrument or mouse\n    * `y`:number - the current y coordinate of the touch instrument or mouse\n* `direction`:object\n    * `x`:string - either 'left' or 'right\n    * `y`:string - either 'up' or 'down\n\n#### end\nTriggered when the touchend or mouseup event occurs.\n\n**data**\n* `start`:object\n    * `x`:number - the starting x coordinate of the touch instrument or mouse\n    * `y`:number - the starting y coordinate of the touch instrument or mouse\n* `end`:object\n    * `x`:number - the end x coordinate of the touch instrument or mouse\n    * `y`:number - the end y coordinate of the touch instrument or mouse\n\n\n\n## License\nCopyright © 2018 Todd Kennedy, [Apache 2.0 License](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))\n\n[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square\n[1]: https://nodejs.org/api/documentation.html#documentation_stability_index\n[2]: https://img.shields.io/npm/v/nanodrag.svg?style=flat-square\n[3]: https://npmjs.org/package/nanodrag\n[4]: https://img.shields.io/travis/toddself/nanodrag/master.svg?style=flat-square\n[5]: https://travis-ci.org/toddself/nanodrag\n[6]: http://img.shields.io/npm/dm/nanodrag.svg?style=flat-square\n[7]: https://npmjs.org/package/nanodrag\n[8]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[9]: https://github.com/feross/standard\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddself%2Fnanodrag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoddself%2Fnanodrag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddself%2Fnanodrag/lists"}