SkillAgentSearch skills...

Codesnap

CodeSnap is a node.js library designed to programmatically generate images of code snippets. It provides a simple and convenient way to create beautiful snapshots of your code for further automated or programmatic usage.

Install / Use

/learn @francosion042/Codesnap
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

CodeSnap

<!-- markdownlint-disable MD029 --> <!-- markdownlint-disable MD033 --> <div align="center">

Publish Package to npmjs npm version License: MIT PRs Welcome Downloads

</div>

CodeSnap is a node.js library designed to programmatically generate images of code snippets. It provides a simple and convenient way to create beautiful snapshots of your code for further automated or programmatic usage.

Installation

To install CodeSnap, you can use npm or yarn:

npm install codesnap

or

yarn add codesnap

Usage

import CodeSnap from "codesnap";

const config = {
  theme: "Monokai",
  backgroundColor: "Cyan",
  numberLines: true,
};

const codeSnap = new CodeSnap(config);

const code = `
function greet() {
  console.log('Hello, world!');
}

greet();
`;

codeSnap.snap(code);
<div align="center"> <img src="examples/codeSnapshot-example.png" alt="example image"> </div>

Configuration

The CodeSnap constructor accepts a configuration object with the following properties:

  • theme: The color theme to use for the code snippet.
  • backgroundColor: The background color of the code snippet.
  • numberLines: (Optional) A boolean value indicating whether to display line numbers.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

CodeSnap is powered by Carbon.now.sh and Puppeteer.

View on GitHub
GitHub Stars7
CategoryDesign
Updated1y ago
Forks0

Languages

JavaScript

Security Score

75/100

Audited on Jul 10, 2024

No findings