{"id":18024008,"url":"https://github.com/lete114/webstack-screenshot","last_synced_at":"2025-03-27T00:30:47.692Z","repository":{"id":40515815,"uuid":"466045581","full_name":"Lete114/WebStack-Screenshot","owner":"Lete114","description":"📸 Website Screenshot API ","archived":false,"fork":false,"pushed_at":"2024-01-24T12:39:33.000Z","size":2261,"stargazers_count":84,"open_issues_count":0,"forks_count":23,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T18:11:20.814Z","etag":null,"topics":["free","image","img","page","screen","screenshot","site","snapshot","website","webstack"],"latest_commit_sha":null,"homepage":"https://webstack-screenshot.vercel.app/?url=https://github.com/Lete114/WebStack-Screenshot\u0026fullPage=true","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/Lete114.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":"2022-03-04T08:38:37.000Z","updated_at":"2025-03-04T09:39:52.000Z","dependencies_parsed_at":"2024-01-07T17:39:50.423Z","dependency_job_id":"73bcfeac-d393-4102-a06d-1963a589e921","html_url":"https://github.com/Lete114/WebStack-Screenshot","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"d7a697ba159cfaa15ea013f3a137d1b02b298c1f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2FWebStack-Screenshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2FWebStack-Screenshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2FWebStack-Screenshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2FWebStack-Screenshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lete114","download_url":"https://codeload.github.com/Lete114/WebStack-Screenshot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245760563,"owners_count":20667886,"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":["free","image","img","page","screen","screenshot","site","snapshot","website","webstack"],"created_at":"2024-10-30T07:11:38.735Z","updated_at":"2025-03-27T00:30:47.372Z","avatar_url":"https://github.com/Lete114.png","language":"TypeScript","readme":"\u003cdiv align=\"right\"\u003e\n  Language:\n  English\n  \u003ca title=\"中文\" href=\"README_CN.md\"\u003e中文\u003c/a\u003e\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003e\u003ca href=\"https://github.com/lete114/WebStack-Screenshot\" target=\"_blank\"\u003eWebStack-Screenshot\u003c/a\u003e\u003c/h1\u003e\n\u003cp align=\"center\"\u003eWebsite Screenshot API \u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Lete114/WebStack-Screenshot/releases/\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/webstack-screenshot?logo=npm\" alt=\"Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/Lete114/WebStack-Screenshot/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/webstack-screenshot\" alt=\"MIT License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n\nJust some simple screenshot operations, if you have any needs, or want to participate in the development, we welcome you to PR\n\n## Quick Start\n\n### Vercel Free Deployment\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/Lete114/WebStack-Screenshot/tree/Vercel)\n\n### Installation\n\n```bash\nnpm install webstack-screenshot --save\n```\n\n```js\nconst webstackScreenshot = require('webstack-screenshot')\n\nwebstackScreenshot({ url: 'https://example.com' }).then((buffer) =\u003e {\n  console.log('buffer', buffer)\n})\n\nwebstackScreenshot({ url: 'https://example.com', encoding: 'base64' }).then((base64) =\u003e {\n  console.log('base64', base64)\n})\n```\n\n### ServerLess\n\n\u003e You need to configure an environment variable name `WEBSTACK_SCREENSHOT_SERVERLESS`, and the value of the environment variable can be any value you want, e.g. `true`.\n\n\u003e You may need to manually configure font files if the intercepted site contains text in other languages.\n\u003e\n\u003e Configure the environment variable name `WEBSTACK_SCREENSHOT_FONTS`, the environment variable value can be a url or a path, multiple font files need to be split by `,`. url address must be `https://`, path must be an absolute path.\n\u003e\n\u003e e.g. `/var/task/fonts/xxx.ttf,https://xxxxx/xxx/xxx.ttf`.\n\n```js\nmodule.exports = require('webstack-screenshot/dist/src/serverless')\n```\n\n### Clone Warehouse\n\nClone remote repository start **Website screenshot API**\n\n```bash\n# Clone the repository and go to the WebStack-Screenshot directory\ngit clone https://github.com/Lete114/WebStack-Screenshot.git WebStack-Screenshot\ncd WebStack-Screenshot\n\n# Installing Dependencies\nnpm install\n\n# Start service\nnpm run start\n```\n\n## Properties\n\nRequest Method: GET | POST\n\n| Properties | Default                                      | Type               | Description                                                                                                       |\n| ---------- | -------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------- |\n| url        |                                              | String             | The URL of the requested website, if the domain name is entered it will be automatically spelled out as `http://` |\n| type       | jpeg                                         | String             | The image type, `png`, `jpeg`, `webp`                                                                             |\n| cache      | 86400                                        | Int \u0026 Boolean      | cache, default cache is 1 day, pass `false` to disable cache, pass number like:`123` to cache 123 seconds         |\n| quality    | 50                                           | Int                | Image quality between **0-100**, ignored if the image type is `png`                                               |\n| viewport   | `{width: 1080,height: 1920,isMobile: false}` | String \\| Viewport | Set the screen window size                                                                                        |\n| fullPage   | false                                        | Boolean            | Capture the full page                                                                                             |\n| isMobile   | false                                        | Boolean            | If or not it is mobile                                                                                            |\n| await      | 1000                                         | Int                | Wait for the page to finish rendering                                                                             |\n| timeout    | 30000                                        | Int                | Screenshot timeout, `0` means no limit (in milliseconds)                                                          |\n| encoding   | binary                                       | String             | Image encoding, `binary`, `base64`                                                                                |\n| clip       |                                              | String             | Clip the specified area, receive 4 units divided by English **comma**, `x,y,width,height`                         |\n| waitUntil  | load                                         | String             | At what time the screenshot is triggered, [see another table below for details](#waituntil)                       |\n\n### waitUntil\n\n| Properties       | Description                                     |\n| ---------------- | ----------------------------------------------- |\n| load             | Done when the load event is fired               |\n| domcontentloaded | Done when the DOMContentLoaded event is fired.  |\n| networkidle0     | When there are no website requests within 500ms |\n| networkidle2     | When there are only 2 requests within 500ms     |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fwebstack-screenshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flete114%2Fwebstack-screenshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fwebstack-screenshot/lists"}