vhs.js
A simple JS library to use https://github.com/charmbracelet/vhs to generate terminal gifs
Install
npm install vhs.js
Usage
import { exportGif, exportGifToFile } from 'vhs.js';
const tape = `
Require echo
Set Shell "bash"
Set FontSize 32
Set Width 1200
Set Height 600
Type "echo 'Welcome to VHS!'" Sleep 500ms Enter
`;
await exportGifToFile(tape, 'tape.gif');
// or do it in memory
const gifBuffer = await exportGif(tape);