{"id":15167499,"url":"https://github.com/darkgl/node-xvfb-ts","last_synced_at":"2025-10-25T12:30:31.280Z","repository":{"id":239801347,"uuid":"800714632","full_name":"DarkGL/node-xvfb-ts","owner":"DarkGL","description":"Easily start and stop an X Virtual Frame Buffer from your node apps","archived":false,"fork":false,"pushed_at":"2024-11-28T17:48:12.000Z","size":146,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T18:56:00.585Z","etag":null,"topics":["buffer","frame","framebuffer","headless","playwright","puppeteer","typescript","virtual","xvfb","xvfb-node","xvfb-ts"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/xvfb-ts","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DarkGL.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-14T21:21:57.000Z","updated_at":"2025-02-06T07:27:35.000Z","dependencies_parsed_at":"2024-05-15T13:24:37.686Z","dependency_job_id":"2db09029-9327-489a-8629-b896e024336e","html_url":"https://github.com/DarkGL/node-xvfb-ts","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"0d9dcf21593cbac6cc317fa68fe94974b946ca53"},"previous_names":["darkgl/node-xvfb-ts"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkGL%2Fnode-xvfb-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkGL%2Fnode-xvfb-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkGL%2Fnode-xvfb-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkGL%2Fnode-xvfb-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarkGL","download_url":"https://codeload.github.com/DarkGL/node-xvfb-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238137858,"owners_count":19422714,"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":["buffer","frame","framebuffer","headless","playwright","puppeteer","typescript","virtual","xvfb","xvfb-node","xvfb-ts"],"created_at":"2024-09-27T06:00:35.165Z","updated_at":"2025-10-25T12:30:31.275Z","avatar_url":"https://github.com/DarkGL.png","language":"TypeScript","readme":"# node-xvfb-ts\n\nA TypeScript library for easily managing X Virtual Frame Buffer (Xvfb) processes in Node.js applications. Perfect for headless GUI testing with tools like Puppeteer, Playwright, or Selenium.\n\n## Installation\n\n```bash\nnpm install xvfb-ts\n```\n\n## Prerequisites\n\n- Linux/Unix system with Xvfb installed\n- Node.js \u003e= 20.17.0\n\n## Quick Start\n\n```typescript\nimport { Xvfb } from 'xvfb-ts';\n\nconst xvfb = new Xvfb();\n\n// Start the virtual display\nawait xvfb.start();\n\n// Run your headless GUI tests here\n// e.g., launch a browser, run Electron app, etc.\n\n// Clean up when done\nawait xvfb.stop();\n```\n\n## API Reference\n\n### Constructor Options\n\n```typescript\ninterface XvfbOptions {\n    displayNum?: number;     // X display number (default: auto-assigned \u003e= 99)\n    reuse?: boolean;         // Reuse existing display (default: false)\n    timeout?: number;        // Startup timeout in ms (default: 500)\n    silent?: boolean;        // Suppress stderr output (default: false)\n    xvfb_args?: string[];    // Additional Xvfb arguments (default: [])\n}\n```\n\n### Methods\n\n- `start()` - Start the Xvfb process (returns Promise\u003cChildProcess\u003e)\n- `stop()` - Stop the Xvfb process (returns Promise\u003cvoid\u003e)\n- `display()` - Get the display string (e.g., \":99\")\n\n## Examples\n\n### Basic Usage with Custom Display\n\n```typescript\nimport { Xvfb } from 'xvfb-ts';\n\nconst xvfb = new Xvfb({ displayNum: 88 });\n\nawait xvfb.start();\n\nconsole.log(`Display: ${xvfb.display()}`); // :88\n\nawait xvfb.stop();\n```\n\n### Reusing Existing Display\n\n```typescript\nconst xvfb = new Xvfb({ \n    displayNum: 99, \n    reuse: true \n});\n\nawait xvfb.start(); // Won't fail if :99 already exists\n```\n\n### Custom Xvfb Arguments\n\n```typescript\nconst xvfb = new Xvfb({\n    xvfb_args: ['-screen', '0', '1024x768x24']\n});\n\nawait xvfb.start();\n```\n\n### Error Handling\n\n```typescript\ntry {\n    await xvfb.start();\n    // Your code here\n} catch (error) {\n    console.error('Failed to start Xvfb:', error.message);\n} finally {\n    await xvfb.stop();\n}\n```\n\n## Credits\n\n* [Rob--W](https://github.com/Rob--W) for the original [node-xvfb](https://github.com/Rob--W/node-xvfb)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkgl%2Fnode-xvfb-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkgl%2Fnode-xvfb-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkgl%2Fnode-xvfb-ts/lists"}