1.1.0 • Published 4 years ago

@egoist/preview-card v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

@egoist/preview-card

Customizable social media preview image, like this one:

Install

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

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

preview-card out.png --title title --domain domain --desc description

# All flags
preview-card --help

Inspiration

Thanks to Mugshot Bot for the original design inspiration.

License

MIT © EGOIST