{"id":15631917,"url":"https://github.com/ianwalter/line","last_synced_at":"2025-07-15T16:04:42.148Z","repository":{"id":43337551,"uuid":"153509450","full_name":"ianwalter/line","owner":"ianwalter","description":"Simple, safe parent-child communication with iframes using postMessage","archived":false,"fork":false,"pushed_at":"2023-10-17T18:54:02.000Z","size":593,"stargazers_count":3,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T04:34:04.341Z","etag":null,"topics":["iframe","postmessage"],"latest_commit_sha":null,"homepage":"","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/ianwalter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"ianwalter"}},"created_at":"2018-10-17T19:05:29.000Z","updated_at":"2023-03-04T05:53:34.000Z","dependencies_parsed_at":"2024-10-03T10:42:52.832Z","dependency_job_id":"84e688d5-0bb7-4a55-9423-e828a351baff","html_url":"https://github.com/ianwalter/line","commit_stats":{"total_commits":72,"total_committers":5,"mean_commits":14.4,"dds":0.5833333333333333,"last_synced_commit":"4322010c4b5ded2796d75ac2e9ffb97f2c22668a"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ianwalter/line","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianwalter%2Fline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianwalter%2Fline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianwalter%2Fline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianwalter%2Fline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianwalter","download_url":"https://codeload.github.com/ianwalter/line/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianwalter%2Fline/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265444278,"owners_count":23766426,"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":["iframe","postmessage"],"created_at":"2024-10-03T10:42:03.743Z","updated_at":"2025-07-15T16:04:41.728Z","avatar_url":"https://github.com/ianwalter.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ianwalter"],"categories":[],"sub_categories":[],"readme":"# @ianwalter/line\n\u003e Simple, safe parent-child communication with iframes using postMessage\n\n[![npm page][npmImage]][npmUrl]\n\n## Installation\n\n```console\nnpm install @ianwalter/line --save\n```\n\n## Usage\n\nParent:\n\n```js\nimport Line from '@ianwalter/line'\n\n// Create a line instance which establishes a communication line between the\n// current window and an iframe within the current window, someIframe.\nconst line = new Line(someIframe)\n\n// Subscribe to the alert topic and handle incoming messages with handleAlert.\nline.sub('alert', handleAlert)\n\n// Send a message to the action topic with some data.\nline.msg('action', { date: new Date() })\n```\n\nChild:\n\n```js\nimport Line from '@ianwalter/line'\n\nif (Line.hasParent()) {\n  // Create a line instance which establishes a communication line between the\n  // current window and, by default, window.parent.\n  const line = new Line()\n\n  // Subscribe to the action topic and handle incoming messages with\n  // executeAction.\n  line.sub('action', executeAction)\n\n  // Send a message to the alert topic with some data.\n  line.msg('alert', { date: new Date() })\n}\n```\n\n## License\n\nApache 2.0 with Commons Clause - See [LICENSE][licenseUrl]\n\n\u0026nbsp;\n\nCreated by [Ian Walter](https://iankwalter.com)\n\n[npmImage]: https://img.shields.io/npm/v/@ianwalter/line.svg\n[npmUrl]: https://www.npmjs.com/package/@ianwalter/line\n[licenseUrl]: https://github.com/ianwalter/line/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianwalter%2Fline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianwalter%2Fline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianwalter%2Fline/lists"}