{"id":29312976,"url":"https://github.com/akshykhade/ngx-foresight","last_synced_at":"2025-07-07T09:13:55.221Z","repository":{"id":302885419,"uuid":"1013835659","full_name":"akshykhade/ngx-foresight","owner":"akshykhade","description":"foresightjs implementation for Angular","archived":false,"fork":false,"pushed_at":"2025-07-04T14:58:29.000Z","size":1679,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-04T16:09:57.493Z","etag":null,"topics":["angular","keyboard-tracking","mouse-tracking","performance","prefetching","speed"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ngx-foresight","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akshykhade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-04T14:43:42.000Z","updated_at":"2025-07-04T14:58:32.000Z","dependencies_parsed_at":"2025-07-04T16:22:22.717Z","dependency_job_id":null,"html_url":"https://github.com/akshykhade/ngx-foresight","commit_stats":null,"previous_names":["akshykhade/ngx-foresight"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akshykhade/ngx-foresight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshykhade%2Fngx-foresight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshykhade%2Fngx-foresight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshykhade%2Fngx-foresight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshykhade%2Fngx-foresight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akshykhade","download_url":"https://codeload.github.com/akshykhade/ngx-foresight/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshykhade%2Fngx-foresight/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264049067,"owners_count":23549405,"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":["angular","keyboard-tracking","mouse-tracking","performance","prefetching","speed"],"created_at":"2025-07-07T09:13:53.819Z","updated_at":"2025-07-07T09:13:55.213Z","avatar_url":"https://github.com/akshykhade.png","language":"HTML","funding_links":[],"categories":["Third Party Components"],"sub_categories":["Router"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://akshykhade.github.io/ngx-foresight/logo.svg\" width=\"305px\"\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/ngx-foresight\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/ngx-foresight.svg?style=for-the-badge\" alt=\"npm version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/ngx-foresight\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/ngx-foresight.svg?style=for-the-badge\" alt=\"npm downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/ngx-foresight\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/last-update/ngx-foresight.svg?style=for-the-badge\" alt=\"last-update\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/akshykhade/ngx-foresight/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/ngx-foresight.svg?style=for-the-badge\" alt=\"license\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/package/ngx-foresight\"\u003e\n    \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/ngx-foresight?style=for-the-badge\" alt=\"bundle size\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# ngx-foresight - [🚀 Demo](https://akshykhade.github.io/ngx-foresight/)\n\n[foresightjs](https://foresightjs.com/) implementation for Angular. It provides router preloading strategy which automatically downloads the lazy-loaded module based on foresightjs prediction of user intent from mouse and keyboard.\n\n[🚀 Demo](https://akshykhade.github.io/ngx-foresight/)\n\n## Usage\n\n![Screenshot](public/example.gif)\n\n## installation\n\n```bash\nnpm install js.foresight js.foresight-devtools ngx-foresight\n# or\npnpm install js.foresight js.foresight-devtools ngx-foresight\n```\n\nAfter that import the `ForesightjsDirective` to the components with `href` and `routerLink`, and use the `ForesightjsStrategy` as `preloadingStrategy` in the router's configuration. For example:\n\n```ts\nimport { ForesightManager } from 'js.foresight';\nimport { ForesightDebugger } from 'js.foresight-devtools';\nimport { ForesightjsDirective } from 'ngx-foresight';\n\nForesightManager.initialize({\n  enableMousePrediction: true,\n  positionHistorySize: 8,\n  trajectoryPredictionTime: 80,\n  defaultHitSlop: 10,\n  enableTabPrediction: true,\n  tabOffset: 3,\n  enableScrollPrediction: true,\n  scrollMargin: 150,\n});\n\nForesightDebugger.initialize(ForesightManager.instance, {\n  showDebugger: true,\n  isControlPanelDefaultMinimized: true, // optional setting which allows you to minimize the control panel on default\n  showNameTags: true, // optional setting which shows the name of the element\n  sortElementList: 'visibility', // optional setting for how the elements in the control panel are sorted\n});\n```\n\n```html\n\u003cdiv class=\"pill-group-horizontal\"\u003e\n  \u003ca href=\"/feature1\" class=\"pill\" foresightjs\u003eFeature 1\u003c/a\u003e\n  \u003ca href=\"/feature2\" class=\"pill\" foresightjs\u003eFeature 2\u003c/a\u003e\n  \u003ca href=\"/feature3\" class=\"pill\" foresightjs\u003eFeature 3\u003c/a\u003e\n\u003c/div\u003e\n```\n\n```ts\n// configure preloading strategy as per routes\n    provideRouter(routes, withPreloading(ForesightjsStrategy)),\n```\n\nInspired by ngx-quicklink - [ngx-quicklink](https://github.com/mgechev/ngx-quicklink) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshykhade%2Fngx-foresight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshykhade%2Fngx-foresight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshykhade%2Fngx-foresight/lists"}