https://github.com/egoist/preview-card
Customizable social media preview image
https://github.com/egoist/preview-card
Last synced: 11 months ago
JSON representation
Customizable social media preview image
- Host: GitHub
- URL: https://github.com/egoist/preview-card
- Owner: egoist
- Created: 2020-11-04T13:16:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-25T13:57:34.000Z (about 4 years ago)
- Last Synced: 2025-04-19T01:32:21.069Z (11 months ago)
- Language: TypeScript
- Homepage:
- Size: 116 KB
- Stars: 56
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-list - preview-card
README
# @egoist/preview-card
Customizable social media preview image, like this one:

## Install
```bash
yarn add @egoist/preview-card
```
**NOTE: this module relies on Chrome (or Chromium) browser, make sure you have it installed on your machine before running this module**.
## Usage
```ts
import { getImage, stopBrowser } from '@egoist/preview-card'
const imageBuffer = await getImage({
title: 'your title',
description: 'your description',
domain: 'your domain',
themeColor: '#e02423', // optional
})
// Close the browser when you no longer need to use this module
await stopBrowser()
```
## CLI Usage
```bash
preview-card out.png --title title --domain domain --desc description
# All flags
preview-card --help
```
## Inspiration
Thanks to [Mugshot Bot](https://www.mugshotbot.com/) for the original design inspiration.
## License
MIT © [EGOIST](https://github.com/sponsors/egoist)