{"id":18062936,"url":"https://github.com/stagas/vipu","last_synced_at":"2026-05-04T21:31:37.949Z","repository":{"id":57392732,"uuid":"425773038","full_name":"stagas/vipu","owner":"stagas","description":"run things in vite headless with node/puppeteer and alice-bob typed rpc","archived":false,"fork":false,"pushed_at":"2021-12-22T16:39:12.000Z","size":277,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-09T03:57:04.407Z","etag":null,"topics":["headless","puppeteer","rpc","vite"],"latest_commit_sha":null,"homepage":"","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/stagas.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}},"created_at":"2021-11-08T09:24:58.000Z","updated_at":"2021-12-22T16:39:15.000Z","dependencies_parsed_at":"2022-09-26T16:51:30.087Z","dependency_job_id":null,"html_url":"https://github.com/stagas/vipu","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/stagas/vipu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagas%2Fvipu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagas%2Fvipu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagas%2Fvipu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagas%2Fvipu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stagas","download_url":"https://codeload.github.com/stagas/vipu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagas%2Fvipu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32625922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: 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":["headless","puppeteer","rpc","vite"],"created_at":"2024-10-31T05:08:56.595Z","updated_at":"2026-05-04T21:31:37.911Z","avatar_url":"https://github.com/stagas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003evipu\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\nrun things in vite headless with node/puppeteer and alice-bob typed rpc\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"#install\"\u003e        🔧 \u003cstrong\u003eInstall\u003c/strong\u003e\u003c/a\u003e\n · \u003ca href=\"#example\"\u003e        🧩 \u003cstrong\u003eExample\u003c/strong\u003e\u003c/a\u003e\n · \u003ca href=\"#api\"\u003e            📜 \u003cstrong\u003eAPI docs\u003c/strong\u003e\u003c/a\u003e\n · \u003ca href=\"https://github.com/stagas/vipu/releases\"\u003e 🔥 \u003cstrong\u003eReleases\u003c/strong\u003e\u003c/a\u003e\n · \u003ca href=\"#contribute\"\u003e     💪🏼 \u003cstrong\u003eContribute\u003c/strong\u003e\u003c/a\u003e\n · \u003ca href=\"https://github.com/stagas/vipu/issues\"\u003e   🖐️ \u003cstrong\u003eHelp\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n***\n\n## Install\n\n```sh\n$ npm i vipu\n```\n\n## What is this?\n\n\u003e *Note:* this project is WIP (work in progress) and its API will probably change.\n\nThis is a development tool combining [`vite`](https://vitejs.dev/) + [`puppeteer`](https://pptr.dev/) + [`alice-bob`](https://github.com/stagas/alice-bob) designed for rapid iteration and testing of frontend solutions without having to switch to the browser. You can interop with Node using RPC which is already configured. Client side refreshes on change as usual with Vite and with a tool like [`onchange`](https://github.com/Qard/onchange) or `nodemon` you can configure the server side to refresh as well.\n\n## Example\n\nOn the server (node.js):\n\n```ts\nimport { vipu } from 'vipu'\nimport type { Client } from './client'\n\nexport interface Server {\n  sayHi: ({ iam }: { iam: string }) =\u003e Promise\u003cstring\u003e\n  finish: () =\u003e Promise\u003cvoid\u003e\n}\n\nexport interface WindowHandle {\n  vipu: {\n    server: Server\n  }\n}\n\nvipu\u003cServer, Client\u003e().then(({ server, client, page, finish }) =\u003e {\n  server.finish = finish\n  server.sayHi = async ({ iam }) =\u003e `hello ${iam}`\n  page.on('load', async () =\u003e {\n    const result = await client.multiply(3, 4)\n    console.log('from client:', result)\n    // =\u003e from client: 12\n  })\n})\n```\n\nOn the client:\n\n```ts\nimport { ready } from 'vipu'\nimport type { VipuWindowInterface } from 'vipu'\nimport type { Server } from './server'\ndeclare const window: VipuWindowInterface\u003cServer, Client\u003e\nexport type Client = typeof client\n;(async () =\u003e {\n  console.log('from server:', await server.sayHi({ iam: 'The Client' }))\n  // =\u003e from server: hello The Client\n})()\n\nconst client = {\n  multiply: async (x: number, y: number) =\u003e x * y,\n}\n\nObject.assign(window.vipu.client, client)\n```\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### Table of Contents\n\n*   [vipu](#vipu)\n\n### vipu\n\n[src/index.ts:57-156](https://github.com/stagas/vipu/blob/9b8a8ca85198f7978985e4fb45877e85d0f9de33/src/index.ts#L57-L156 \"Source code on GitHub\")\n\nCreates a vipu instance.\n\n#### Parameters\n\n*   `config` **Config** Configuration.\u0026#x20;(optional, default `{}`)\n\n    *   `config.rpc`  Passed to AliceBob [`agents`](https://github.com/stagas/alice-bob/#agents).\u0026#x20;(optional, default `{}`)\n    *   `config.vite`  Vite configuration. Passed to vite [`createServer`](https://vitejs.dev/guide/api-javascript.html#createserver).\u0026#x20;(optional, default `{}`)\n    *   `config.puppeteer`  Puppeteer launch configuration. Passed to [`puppeteer.launch`](https://pptr.dev/#?product=Puppeteer\\\u0026version=v11.0.0\\\u0026show=api-puppeteerlaunchoptions).\u0026#x20;(optional, default `{}`)\n    *   `config.info`  Whether to display info messages in console.\u0026#x20;(optional, default `true`)\n    *   `config.log`  Log function that can be overriden.\u0026#x20;(optional, default `vipuLog`)\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\\u003cVipu\\\u003cServer, Client\u003e\u003e**\u0026#x20;\n\n## Contribute\n\n[Fork](https://github.com/stagas/vipu/fork) or\n[edit](https://github.dev/stagas/vipu) and submit a PR.\n\nAll contributions are welcome!\n\n## License\n\nMIT © 2021\n[stagas](https://github.com/stagas)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstagas%2Fvipu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstagas%2Fvipu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstagas%2Fvipu/lists"}