3.0.0 • Published 2 years ago

code-to-image v3.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Code-to-image

Ever wondered how to make those beautiful images you see online of people's code? Don't worry, I have the solution for you.

First, install this package using npm i code-to-image Then, install the dependencies npm i puppeteer

Now, require the function generateImage into your project:

const generateImage = require("code-to-image");

And begin using it!

generateImage(code, lines, rgba, theme);

This function will return a buffer which you can later use to create an image.

Pay attention to the type of the variables!

code = String; //The code you want to be shown in the image itself.
lines = Boolean; //Specify if you want the number of the lines to be shown or not.
rgba = String; //The background color of the image. Must be something like this: rgba(1,1,1,1)
theme = String; //Must be from this array:["3024 Night", "A11y-Dark", "Blackboard", "Base-16", "Cobalt", "Dracula-Pro", "Duotone", "Hopscotch", "Lucario", "Material", "Monokai", "Night-Owl", "Nord", "Oceanic-Next", "One-Light", "One-Dark", "Panda", "Paraiso", "Seti", "Shades-of-Purple", "Solarized", "Twilight", "Verminal", "VSCode", "Yeti", "Zenburn"]. Capitalization doesn't matter.

That's it, enjoy!

3.0.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago