{"id":21406919,"url":"https://github.com/francosion042/codesnap","last_synced_at":"2025-07-14T00:32:57.202Z","repository":{"id":221764232,"uuid":"754126410","full_name":"francosion042/codesnap","owner":"francosion042","description":"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.","archived":false,"fork":false,"pushed_at":"2024-02-10T13:19:26.000Z","size":246,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T01:05:46.519Z","etag":null,"topics":["code-to-image","image-generation","nodejs","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/codesnap","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/francosion042.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-07T13:02:54.000Z","updated_at":"2024-07-10T13:49:44.000Z","dependencies_parsed_at":"2024-02-09T23:26:50.389Z","dependency_job_id":"53323c51-4bf1-448e-bef7-c42cf6371689","html_url":"https://github.com/francosion042/codesnap","commit_stats":null,"previous_names":["francosion042/codesnap"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/francosion042/codesnap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francosion042%2Fcodesnap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francosion042%2Fcodesnap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francosion042%2Fcodesnap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francosion042%2Fcodesnap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/francosion042","download_url":"https://codeload.github.com/francosion042/codesnap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francosion042%2Fcodesnap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265227900,"owners_count":23731060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-to-image","image-generation","nodejs","npm-package"],"created_at":"2024-11-22T16:43:39.335Z","updated_at":"2025-07-14T00:32:52.184Z","avatar_url":"https://github.com/francosion042.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeSnap\n\n\u003c!-- markdownlint-disable MD029 --\u003e\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003cdiv align=\"center\"\u003e\n\n[![Publish Package to npmjs](https://github.com/francosion042/codesnap/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/francosion042/codesnap/actions/workflows/npm-publish.yml) [![npm version](https://img.shields.io/npm/v/codesnap.svg?style=flat-square)](https://www.npmjs.org/package/codesnap) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Downloads](https://img.shields.io/npm/dm/codesnap.svg)](https://www.npmjs.com/package/codesnap)\n\n\u003c/div\u003e\n\nCodeSnap 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.\n\n## Installation\n\nTo install CodeSnap, you can use npm or yarn:\n\n```bash\nnpm install codesnap\n```\n\nor\n\n```bash\nyarn add codesnap\n```\n\n## Usage\n\n```javascript\nimport CodeSnap from \"codesnap\";\n\nconst config = {\n  theme: \"Monokai\",\n  backgroundColor: \"Cyan\",\n  numberLines: true,\n};\n\nconst codeSnap = new CodeSnap(config);\n\nconst code = `\nfunction greet() {\n  console.log('Hello, world!');\n}\n\ngreet();\n`;\n\ncodeSnap.snap(code);\n```\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"examples/codeSnapshot-example.png\" alt=\"example image\"\u003e\n\u003c/div\u003e\n\n## Configuration\n\nThe `CodeSnap` constructor accepts a configuration object with the following properties:\n\n- `theme`: The color theme to use for the code snippet.\n- `backgroundColor`: The background color of the code snippet.\n- `numberLines`: (Optional) A boolean value indicating whether to display line numbers.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Credits\n\nCodeSnap is powered by [Carbon.now.sh](https://carbon.now.sh/) and [Puppeteer](https://github.com/puppeteer/puppeteer).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancosion042%2Fcodesnap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrancosion042%2Fcodesnap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancosion042%2Fcodesnap/lists"}