Npm package to generate carbon images
npm install carbon-screenshots
or
yarn add carbon-screenshots
import { phraseGenerator } from "carbon-screenshots";
const text = 'Adding a text to carbon to get its screenshot'
const { body, image } = await phraseGenerator(
text,
"json",
"Seti",
`${__dirname}/../public/images/`,
);
constole.log(body, image); //`body` returns the text you added , `image` will return the image path.