Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback

deno-silicon

Deno module to generate images from source code using Aloxaf/silicon.

Dependencies

Please refer silicon’s dependencies

Usage

You can call generateImage(code, language, options) to generates image from source code.

const code = `package main

import {
  "fmt"
}

func main() {
    fmt.Println("Hello World")
}`;

const r = await generateImage(code, "go", { theme: "Dracula" });
await Deno.writeFile("out.png", await readAll(r));

code and language are required; options is optional.
The options conform to silicon options, see silicon help for details.

Thanks