Skip to content

Create a beautiful image with some Highlight With Your Codes

License

Notifications You must be signed in to change notification settings

XanderID/carbon-now-Scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

carbon-now-scraper

Create a beautiful image with some Highlight With Your Codes

What's News?

  • Now With Promise so you can check If the file has finished downloading!

Argument

To use the carbon-now-scraper, 2 arguments and 1 optional are needed.

Argument Type Needed Description
code string Needed Code to be used as Image
output string Needed Output for Image file
options object Optional Options to customize themes, languages, and others

Options

Options Type Description Default
lang string Program Languages auto
theme string Set Themes for Image dracula
background string Set Background for Image rgba(171, 184, 195, 1)
font string Set Font for Write Hack
window-controls boolean Show 3 Colored dots in the top left corner true
width-adjustment boolean Auto new line if the text is too long in 1 line true
line boolean Show Line numbers true
first-line int First Line Numbers 0
watermark boolean Show Carbon Watermark true

Basic Usage

With No Options

const carbon = require('carbon-now-scraper');

let code = `<?php
    echo "Hi There!";
?>`
let output = "./php.png"

carbon(code, output)

With Options

const carbon = require('carbon-now-scraper');

let code = `<?php
    echo "Hi There!";
?>`
let output = "./php.png"
let options = {
    lang: "php",
    theme: "a11y-dark"
}

carbon(code, output, options)

With Promise

const carbon = require('carbon-now-scraper');

let code = `<?php
    echo "Hi There!";
?>`
let output = "./php.png"
let options = {
    lang: "php",
    theme: "a11y-dark"
}

carbon(code, output, options).then((downloaded) => {
    console.log(`File successfully downloaded in ${downloaded}`)
})

Output:
php.png

Note

  • This is Unofficial carbon.now.sh Package
  • You can use Hex Color for Background Color
  • You Can Check all Available Themes, Languages, and Font in here

About

Create a beautiful image with some Highlight With Your Codes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published