{"id":14384802,"url":"https://github.com/kevva/screenshot-stream","last_synced_at":"2025-04-05T18:11:54.646Z","repository":{"id":21639586,"uuid":"24960233","full_name":"kevva/screenshot-stream","owner":"kevva","description":"Capture screenshot of a website and return it as a stream","archived":false,"fork":false,"pushed_at":"2019-03-28T03:48:41.000Z","size":101,"stargazers_count":235,"open_issues_count":9,"forks_count":38,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-29T17:11:19.567Z","etag":null,"topics":["capture","nodejs","phantomjs","screenshot","stream","webpage"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/kevva.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}},"created_at":"2014-10-08T20:49:47.000Z","updated_at":"2025-02-28T03:02:23.000Z","dependencies_parsed_at":"2022-08-17T19:50:12.577Z","dependency_job_id":null,"html_url":"https://github.com/kevva/screenshot-stream","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fscreenshot-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fscreenshot-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fscreenshot-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fscreenshot-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevva","download_url":"https://codeload.github.com/kevva/screenshot-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378152,"owners_count":20929297,"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":["capture","nodejs","phantomjs","screenshot","stream","webpage"],"created_at":"2024-08-28T18:01:40.907Z","updated_at":"2025-04-05T18:11:54.620Z","avatar_url":"https://github.com/kevva.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# screenshot-stream [![Build Status](https://travis-ci.org/kevva/screenshot-stream.svg?branch=master)](https://travis-ci.org/kevva/screenshot-stream)\n\n\u003e Capture screenshot of a website and return it as a stream\n\n\n## Install\n\n```\n$ npm install --save screenshot-stream\n```\n\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst screenshot = require('screenshot-stream');\n\nconst stream = screenshot('http://google.com', '1024x768', {crop: true});\n\nstream.pipe(fs.createWriteStream('google.com-1024x768.png'));\n```\n\n\n## API\n\n### screenshot(url, size, [options])\n\n#### url\n\nType: `string`\n\nAdd page to capture.\n\n#### size\n\nType: `string`\n\nSet viewport size.\n\n#### options\n\nType: `Object`\n\nDefine options to be used.\n\n##### crop\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nCrop to the set height.\n\n##### delay\n\nType: `number` *(seconds)*\u003cbr\u003e\nDefault: `0`\n\nDelay capturing the screenshot. Useful when the site does things after load that you want to capture.\n\n##### timeout\n\nType: `number` *(seconds)*\u003cbr\u003e\nDefault: `60`\n\nNumber of seconds after which PhantomJS aborts the request.\n\n##### selector\n\nType: `string`\n\nCapture a specific DOM element.\n\n##### css\n\nType: `string`\n\nApply custom CSS to the webpage. Specify some CSS or the path to a CSS file.\n\n##### script\n\nType: `string`\n\nApply custom JavaScript to the webpage. Specify some JavaScript or the path to a file.\n\n##### hide\n\nType: `Array`\n\nHide an array of DOM elements.\n\n##### headers\n\nType: `Object`\u003cbr\u003e\nDefault: `{}`\n\nSet custom headers.\n\n##### cookies\n\nType: `Array` or `Object`\n\nA string with the same format as a [browser cookie](http://en.wikipedia.org/wiki/HTTP_cookie) or an object of what [`phantomjs.addCookie`](http://phantomjs.org/api/phantom/method/add-cookie.html) accepts.\n\n##### username\n\nType: `string`\n\nUsername for authenticating with HTTP auth.\n\n##### password\n\nType: `string`\n\nPassword for authenticating with HTTP auth.\n\n##### format\n\nType: `string`\u003cbr\u003e\nDefault: `png`\n\nSet format to render the image as. Supported formats are `png` and `jpg`.\n\n##### scale\n\nType: `number`\u003cbr\u003e\nDefault: `1`\n\nScale webpage `n` times.\n\n##### userAgent\n\nType: `string`\n\nSet a custom user agent.\n\n##### transparent\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nSet background color to `transparent` instead of `white` if no background is set.\n\n#### .on('error', callback)\n\nType: `Function`\n\nPhantomJS errors.\n\n#### .on('warning', callback)\n\nType: `Function`\n\nWarnings with for example page errors.\n\n\n## CLI\n\nSee the [pageres](https://github.com/sindresorhus/pageres#usage) CLI.\n\n\n## License\n\nMIT © [Kevin Mårtensson](https://github.com/kevva)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevva%2Fscreenshot-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevva%2Fscreenshot-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevva%2Fscreenshot-stream/lists"}