A good code snippet for your posts 💻

Nico Montiel - Feb 18 - - Dev Community

I just want to share with you a cool tool that I have been using a lot lately called "Carbon". It allows you to create and share beautiful images of your source code.

Image of Carbon landing page

This is pretty useful if you want to share some code in Slack, LinkedIn, or even in a post here.
It is super easy to use and super easy to customize.

Of course, you can write your code here and it looks good, right?

// taking kilometers input from the user
const kilometers = prompt("Enter value in kilometers: ")

// conversion factor
const factor = 0.621371

// calculate miles
const miles = kilometers * factor

console.log(`${kilometers} kilometers is equal to ${miles} miles.`);
Enter fullscreen mode Exit fullscreen mode

But c'mon, this looks clean

Code snippet from Carbon

That's all, I hope it can be helpful for you 🥳

. . . . . . . .