Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cestef/spotify-card

Generate spotify embeds using canvas
https://github.com/cestef/spotify-card

canvas discord spotify typescript

Last synced: about 1 month ago
JSON representation

Generate spotify embeds using canvas

Awesome Lists containing this project

README

        

Generate song embeds easily !

![Preview](media/preview.png)

# spotify-card

## Table of Contents

- [About](#about)
- [Prerequisites](#prerequisites)
- [Installing](#installing)
- [Usage](#usage)

## About

This is a nodejs utility to generate song embeds using [skia-canvas](https://github.com/samizdatco/skia-canvas).

The package is named `spotify-card` because I wanted to only add spotify support at the beginning but I ended up adding support for other platforms.

Currently supported plaforms: `Spotify`, `Soundcloud`, `Youtube` and `Deezer`

## Prerequisites

- [nodejs](https://nodejs.org)

## Installing

You can install this package from the [npm](https://npmjs.com) registry

```
yarn add spotify-card
```

or with the npm cli:

```
npm install spotify-card
```

## Usage

### Example (typescript)

```ts
import { generate } from "spotify-card";
import path from "path";
import fs from "fs";

(async () => {
const image = await generate({
url: "spotify:track:33yAEqzKXexYM3WlOYtTfQ",
});
fs.writeFileSync(path.join(__dirname, "test_image.png"), image);
})();

```