{"id":13624093,"url":"https://github.com/juliangruber/capture-screenshot","last_synced_at":"2025-04-04T20:12:30.261Z","repository":{"id":10266089,"uuid":"12378009","full_name":"juliangruber/capture-screenshot","owner":"juliangruber","description":"Capture screenshots in multiple browsers!","archived":false,"fork":false,"pushed_at":"2023-01-11T00:57:54.000Z","size":8080,"stargazers_count":417,"open_issues_count":8,"forks_count":37,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-30T06:58:47.035Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/juliangruber.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":"2013-08-26T11:57:06.000Z","updated_at":"2024-10-10T10:57:09.000Z","dependencies_parsed_at":"2023-01-13T15:50:15.514Z","dependency_job_id":null,"html_url":"https://github.com/juliangruber/capture-screenshot","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliangruber%2Fcapture-screenshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliangruber%2Fcapture-screenshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliangruber%2Fcapture-screenshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliangruber%2Fcapture-screenshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliangruber","download_url":"https://codeload.github.com/juliangruber/capture-screenshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242681,"owners_count":20907134,"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":[],"created_at":"2024-08-01T21:01:38.736Z","updated_at":"2025-04-04T20:12:30.240Z","avatar_url":"https://github.com/juliangruber.png","language":"JavaScript","funding_links":["https://www.patreon.com/juliangruber"],"categories":["JavaScript"],"sub_categories":[],"readme":"# capture-screenshot\n\nCapture screenshots in multiple browsers. One module, to rule them all!\n\n[![build status](https://secure.travis-ci.org/juliangruber/capture-screenshot.png)](http://travis-ci.org/juliangruber/capture-screenshot)\n\n## Browsers\n\n- [X] Chrome Headless\n- [X] Electron\n- [X] PhantomJS\n- [ ] Firefox Headless\n\n## Usage\n\nCapture `1024x768` screenshots of `https://twitter.com/` in Chrome, Electron and PhantomJS:\n\n```js\nconst capture = require('capture-screenshot')\nconst fs = require('fs')\n\ncapture({ url: 'https://twitter.com/' })\n  .then(imgs =\u003e {\n    fs.writeFileSync('chrome.png', imgs.chrome)\n    fs.writeFileSync('electron.png', imgs.electron)\n    fs.writeFileSync('phantomjs.png', imgs.phantomjs)\n  })\n```\n\n| Chrome | Electron | PhantomJS |\n|---|---|--|\n| \u003cimg alt=\"chrome\" src=\"https://raw.github.com/juliangruber/capture-screenshot/master/example-chrome.png\" width=300 /\u003e| \u003cimg alt=\"electron\" src=\"https://raw.github.com/juliangruber/capture-screenshot/master/example-electron.png\" width=300 /\u003e | \u003cimg alt=\"phantomjs\" src=\"https://raw.github.com/juliangruber/capture-screenshot/master/example-phantomjs.png\" width=300 /\u003e |\n\n## API\n\n### capture({ url, browsers = ['chrome', 'electron', 'phantomjs'], width = 1024, height = 768 })\n\nCapture a screenshot of `url`, returns a `Promise` which resolves with an Object of Buffers.\n\nOptions:\n\n- `url` Page url\n- `browsers` The browsers to test\n- `width` Viewport width\n- `height` Viewport height\n\n## Installation\n\n```bash\n$ npm install capture-screenshot\n```\n\n## CI\n\nIf you use the `electron` browser, this project requires an `xvfb` setup to be running in your CI environment.\nFor an example how to set one up, check out the [.travis.yml](https://github.com/juliangruber/capture-screenshot/blob/master/.travis.yml).\nAfter that, no further setup is required however, as all the executables are\ninstalled automatically.\n\n## Related projects\n\n- __[capture-chrome](https://github.com/juliangruber/capture-chrome)__ \u0026mdash; Capture screenshots using Chrome\n- __[capture-electron](https://github.com/juliangruber/capture-electron)__ \u0026mdash; Capture screenshots using Electron\n- __[capture-phantomjs](https://github.com/juliangruber/capture-phantomjs)__ \u0026mdash; Capture screenshots using PhantomJS\n\n## Sponsors\n\nThis module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!\n\nDo you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!\n\n## License\n\nMIT\n\nCopyright (c) 2017 Julian Gruber \u0026lt;julian@juliangruber.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliangruber%2Fcapture-screenshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliangruber%2Fcapture-screenshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliangruber%2Fcapture-screenshot/lists"}