{"id":19095109,"url":"https://github.com/hardpool/js-bridge","last_synced_at":"2026-05-05T04:33:04.684Z","repository":{"id":98568484,"uuid":"264598605","full_name":"hardpool/js-bridge","owner":"hardpool","description":"Bridge between pure vanilla javascript and angular. Expose selected methods of angular component on javascript window object and call them from external javascript application. Making angular app plugable/co-exist with other front end app.","archived":false,"fork":false,"pushed_at":"2020-06-12T21:02:30.000Z","size":521,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T01:54:42.549Z","etag":null,"topics":["angular","javascript","library","npm"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/hardpool.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}},"created_at":"2020-05-17T06:26:33.000Z","updated_at":"2020-06-12T21:02:32.000Z","dependencies_parsed_at":"2023-04-14T14:16:13.888Z","dependency_job_id":null,"html_url":"https://github.com/hardpool/js-bridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hardpool/js-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpool%2Fjs-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpool%2Fjs-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpool%2Fjs-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpool%2Fjs-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hardpool","download_url":"https://codeload.github.com/hardpool/js-bridge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpool%2Fjs-bridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019418,"owners_count":26086575,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["angular","javascript","library","npm"],"created_at":"2024-11-09T03:32:48.378Z","updated_at":"2025-10-14T12:08:13.847Z","avatar_url":"https://github.com/hardpool.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @hardpool/js-bridge\n![Example GIF](https://img.shields.io/badge/support-angular%209.x-brightgreen.svg)  ![Example GIF](https://img.shields.io/badge/support-angular%205.x+-brightgreen.svg)\n\nBridge between pure vanilla javascript and angular. Expose selected methods of angular component on javascript window object and call them from external javascript application. Making angular app plugable/co-exist with other front end app. \n\n## Demo\n[Click here to see it in action!](https://jsbridge.hardikdabhi.com/)\n\n## Installation\n`npm i @hardpool/js-bridge`\n\n## Usage\nImport `JsBridgeModule` in your module.\n``` typescript\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\n\nimport { JsBridgeModule } from '@hardpool/js-bridge';\n\n@NgModule({\n  // ...\n  imports: [\n\t// ...\n\tJsBridgeModule.forRoot()\n  ],\n  // ...\n})\nexport class AppModule { }\n```\n\nImport service in component and expose component methods as required [using js bridge methods](#API).\n\ncomponent.ts\n``` typescript\nimport { JsBridgeService } from '@hardpool/js-bridge';\n\n@Component({\n  // ...\n})\nexport class DemoComponent implements OnInit {\n\tconstructor(..., jsBridge: JsBridgeService, ...) {\n\t\tjsBridge.exposeMethod(this, \"someNamespace\", \"someMethod\");\n\t}\n\n\tsomeMethod(...params) {\n\t\t...\n\t}\n}\n```\n\nIn javascript call method like,\n``` javascript\nsomeNamespace.someMethod(...args);\n```\n\n## API\n\nBelow are the methods exposed by `JsBridge`.\n\n| Method | Details |\n| :--- | :--- |\n| `exposeMethod(classRef: any, namespace: string, fnName: string[] \u0026#124; string)` | Expose angular component method on javascript window object. `classRef`: Reference of current class, generally `this` `namespace`: Name of namespace on which method is exposed, could be any string, if null method will be exposed on `window` `fnName`: Name of function to be exposed, nust match component method name |\n| `executeMethod(namespace: string, methodName: string, ...args: any[])` | Executes javascript method outsize angular |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardpool%2Fjs-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhardpool%2Fjs-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardpool%2Fjs-bridge/lists"}