{"id":19617797,"url":"https://github.com/nzambello/link-previewer","last_synced_at":"2025-04-28T02:32:08.887Z","repository":{"id":43574252,"uuid":"486598558","full_name":"nzambello/link-previewer","owner":"nzambello","description":"Node util to retrieve preview info from a link (og tags, meta tags, images, videos)","archived":false,"fork":false,"pushed_at":"2022-07-07T08:03:54.000Z","size":184,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T16:53:38.978Z","etag":null,"topics":["link-preview","nodejs","og-tags","opengraph","opengraph-tags","preview","previewer"],"latest_commit_sha":null,"homepage":"","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/nzambello.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-04-28T13:08:09.000Z","updated_at":"2023-10-11T14:38:50.000Z","dependencies_parsed_at":"2022-09-18T22:50:44.120Z","dependency_job_id":null,"html_url":"https://github.com/nzambello/link-previewer","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzambello%2Flink-previewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzambello%2Flink-previewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzambello%2Flink-previewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzambello%2Flink-previewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nzambello","download_url":"https://codeload.github.com/nzambello/link-previewer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251238221,"owners_count":21557420,"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":["link-preview","nodejs","og-tags","opengraph","opengraph-tags","preview","previewer"],"created_at":"2024-11-11T11:07:18.023Z","updated_at":"2025-04-28T02:32:08.560Z","avatar_url":"https://github.com/nzambello.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# link-previewer\n\n[![npm version](https://img.shields.io/github/package-json/v/nzambello/link-previewer)](https://www.npmjs.com/package/@nzambello/link-previewer)\n![Tests](https://github.com/nzambello/link-previewer/workflows/CI/badge.svg?branch=main)\n![TypeScript Support](https://img.shields.io/badge/TypeScript-Support-blue)\n\nNode util to retrieve preview info from a link (og tags, meta tags, images, videos).\n\n## Installation\n\n```bash\nyarn add @nzambello/link-previewer\n```\n\n```bash\nnpm install @nzambello/link-previewer\n```\n\n## Usage\n\n```ts\nimport type { ILinkPreviewInfo } from '@nzambello/link-previewer';\nimport getLinkPreview from '@nzambello/link-previewer';\n\ngetLinkPreview('https://www.youtube.com/watch?v=feH26j3rBz8').then(console.log);\n```\n\n### Result\n\n```json\n{\n  \"description\": \"How much do we know about the impact of technologies we use everyday? How much the web industry is responsible for carbon emissions? Can we define an ethic d...\",\n  \"favicon\": \"https://www.youtube.com/s/desktop/ce262d3b/img/favicon.ico\",\n  \"image\": \"https://i.ytimg.com/vi/feH26j3rBz8/maxresdefault.jpg\",\n  \"imageHeight\": 720,\n  \"imageWidth\": 1280,\n  \"images\": [],\n  \"mediaType\": \"video.other\",\n  \"siteName\": \"YouTube\",\n  \"title\": \"A sustainable web: is it possible? - Nicola Zambello\",\n  \"video\": \"https://www.youtube.com/embed/feH26j3rBz8\",\n  \"videos\": []\n}\n```\n\n## Development\n\nTo run TSDX, use:\n\n```bash\nnpm start # or yarn start\n```\n\nThis builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.\n\nTo do a one-off build, use `npm run build` or `yarn build`.\n\nTo run tests, use `npm test` or `yarn test`.\n\n### Formatting and linting\n\nCode quality is set up with `prettier`, `husky`, and `lint-staged`.\n\n### Jest\n\nJest tests are set up to run with `npm test` or `yarn test`.\n\n### Bundle Analysis\n\n[`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.\n\n### Rollup\n\nTSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.\n\n### TypeScript\n\n`tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.\n\n### Continuous Integration\n\n#### GitHub Actions\n\nTwo actions are added by default:\n\n- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix\n- `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)\n\n### Optimizations\n\nPlease see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:\n\n```js\n// ./types/index.d.ts\ndeclare var __DEV__: boolean;\n\n// inside your code...\nif (__DEV__) {\n  console.log('foo');\n}\n```\n\nYou can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.\n\n### Module Formats\n\nCJS, ESModules, and UMD module formats are supported.\n\nThe appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.\n\n### Commitlint\n\nWe use [commmitlint](https://commitlint.js.org/) for commit message validation based on [Conventional Commits](https://www.conventionalcommits.org/en/).\n\n### Release\n\nChangelog and release management with [release-it](https://github.com/release-it/release-it), using [convential changelog](https://github.com/release-it/conventional-changelog).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzambello%2Flink-previewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnzambello%2Flink-previewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzambello%2Flink-previewer/lists"}