{"id":20330573,"url":"https://github.com/fullengineer/link-preview-generator","last_synced_at":"2026-05-05T16:06:46.097Z","repository":{"id":254086719,"uuid":"845437013","full_name":"fullengineer/link-preview-generator","owner":"fullengineer","description":"Get preview data (a title, description, image, domain name) from a url. Library uses puppeteer headless browser to scrape the web site.","archived":false,"fork":false,"pushed_at":"2024-08-21T09:14:00.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-14T15:23:30.578Z","etag":null,"topics":["javascript","link-preview","node","node-js","open-graph","preview","url"],"latest_commit_sha":null,"homepage":"","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/fullengineer.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-08-21T08:49:02.000Z","updated_at":"2024-08-21T09:14:03.000Z","dependencies_parsed_at":"2024-08-21T10:53:08.323Z","dependency_job_id":null,"html_url":"https://github.com/fullengineer/link-preview-generator","commit_stats":null,"previous_names":["fullengineer/link-preview-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullengineer%2Flink-preview-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullengineer%2Flink-preview-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullengineer%2Flink-preview-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullengineer%2Flink-preview-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fullengineer","download_url":"https://codeload.github.com/fullengineer/link-preview-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241851233,"owners_count":20030961,"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":["javascript","link-preview","node","node-js","open-graph","preview","url"],"created_at":"2024-11-14T20:16:43.441Z","updated_at":"2026-05-05T16:06:41.065Z","avatar_url":"https://github.com/fullengineer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# link-preview-generator\n\n![NPM Downloads](https://img.shields.io/npm/dw/link-preview-generator)\n![NPM License](https://img.shields.io/npm/l/link-preview-generator)\n\n\u003e Get preview data (a title, description, image, domain name) from a url. Library uses puppeteer headless browser to scrape the web site.\n\n## Install\n\n```\n$ npm install link-preview-generator\n```\n\n## Usage\n\n```js\nconst linkPreviewGenerator = require(\"link-preview-generator\");\n\nconst previewData = await linkPreviewGenerator(\n  \"https://www.youtube.com/watch?v=8mqqY2Ji7_g\"\n);\nconsole.log(previewData);\n/*\n{\n  title: 'Kiteboarding: Stylish Backroll in 4 Sessions - Ride with Blake: Vlog 20',\n  description: 'The backroll is a staple in your kiteboarding trick ' +\n    'bag. With a few small adjustments, you can really ' +\n    'improve your style and make this basic your own. ' +\n    'Sessio...',\n  domain: 'youtube.com',\n  img: 'https://i.ytimg.com/vi/8mqqY2Ji7_g/hqdefault.jpg',\n  favicon: 'https://www.youtube.com/s/desktop/d3411c39/img/favicon.ico'\n}\n*/\n```\n\n## API\n\n### linkPreviewGenerator(url, puppeteerArgs?, puppeteerAgent?)\n\nAccepts a `url`, which is scraped and optional parameters `puppeteerArgs` -- browser options and `puppeteerAgent` -- browser user agent.\n\nReturns an object with preview data of `url`.\n\n#### url\n\nType: `string`\n\nScraped url.\n\n#### puppeteerArgs\n\nType: `array`\n\nOptions to set on the Chrome browser.\n\n#### puppeteerAgent\n\nType: `string`\n\nSpecific user agent to use.\n\n## Troubleshooting\nIf you need to deploy this library (Puppeteer) on Heroku, follow [these steps](https://stackoverflow.com/a/55090914/968379).\n\nIf you want to run this library from within a Docker container:\n1. pass the following puppeteer arguments as second argument\n```json\n// Required for Docker version of Puppeteer\n'--no-sandbox',\n'--disable-setuid-sandbox',\n// This will write shared memory files into /tmp instead of /dev/shm,\n// because Docker’s default for /dev/shm is 64MB\n'--disable-dev-shm-usage'\n```\n2. make sure your Docker image has all needed dependencies for headless chrome or just go straight away with [buildkite/puppeteer](https://hub.docker.com/r/buildkite/puppeteer/dockerfile)\n3. done\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullengineer%2Flink-preview-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffullengineer%2Flink-preview-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullengineer%2Flink-preview-generator/lists"}