{"id":16434590,"url":"https://github.com/zce/m2i-cli","last_synced_at":"2026-03-05T09:32:18.655Z","repository":{"id":39095890,"uuid":"249611495","full_name":"zce/m2i-cli","owner":"zce","description":"📝 ⇢ 🌄 A minimalist markdown to image converter","archived":false,"fork":false,"pushed_at":"2023-11-29T21:48:23.000Z","size":128,"stargazers_count":3,"open_issues_count":14,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T10:40:29.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/zce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-03-24T04:20:17.000Z","updated_at":"2021-07-07T12:46:26.000Z","dependencies_parsed_at":"2023-09-27T17:05:40.257Z","dependency_job_id":"55d92974-d101-462c-8303-25c964427f21","html_url":"https://github.com/zce/m2i-cli","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":0.2222222222222222,"last_synced_commit":"1c08ef7b1057b66ff64ea5cf6d0dc91df5a57140"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/zce/m2i-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fm2i-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fm2i-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fm2i-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fm2i-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zce","download_url":"https://codeload.github.com/zce/m2i-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fm2i-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-11T08:49:36.361Z","updated_at":"2026-03-05T09:32:18.630Z","avatar_url":"https://github.com/zce.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# m2i\n\n[![Build Status][actions-img]][actions-url]\n[![Coverage Status][codecov-img]][codecov-url]\n[![License][license-img]][license-url]\n[![NPM Downloads][downloads-img]][downloads-url]\n[![NPM Version][version-img]][version-url]\n[![Dependency Status][dependency-img]][dependency-url]\n[![devDependency Status][devdependency-img]][devdependency-url]\n[![Code Style][style-img]][style-url]\n\n\u003e A minimalist markdown to image converter, built with [puppeteer](https://pptr.dev).\n\n## Installation\n\n```shell\n$ npm install m2i\n\n# or yarn\n$ yarn add m2i\n```\n\n## CLI Usage\n\nUse npx:\n\n```shell\n$ npx m2i \u003cinput\u003e [options]\n```\n\nGlobally install:\n\n```shell\n$ npm install m2i -g\n# or yarn\n$ yarn global add m2i\n```\n\n```shell\n$ m2i --help\nm2i/0.4.0\n\nUsage:\n  $ m2i \u003cinput\u003e\n\nCommands:\n  \u003cinput\u003e  Convert markdown to image\n\nFor more info, run any command with the `--help` flag:\n  $ m2i --help\n\nOptions:\n  -o, --output \u003coutput\u003e  Output filename\n  -w, --width \u003cwidth\u003e    Output image width\n  -s, --scale \u003cscale\u003e    Device scale factor\n  -p, --pdf              Output pdf\n  -h, --help             Display this message\n  -v, --version          Display version number\n\nExamples:\n  $ m2i example.md -o output.png -w 500\n  $ m2i example.md -o output.pdf -p\n```\n\nm2i will automatically find the chrome or edge installed on your computer.\n\nYou can also use `CHROMIUM_PATH` provides an executable chromium file path:\n\n```shell\n$ CHROMIUM_PATH=\"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge\" npx m2i README.md\n```\n\n## Advanced Usage\n\nBy default, the conversion process of markdown does not do extra things. If you want to change the output format, you can customize the template of markdown or HTML in the configuration file.\n\nThis is good for customizing some shared content, or import custom style file.\n\n`.m2irc` example:\n\n```yaml\n# custom chromium executable path\nchromium: '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge'\n# custom common shared content\nmarkdown: |\n  {{placeholder}}\n\n  ## License\n\n  Licensed under the MIT License.\n# custom render html template\nhtml: |\n  \u003clink rel=\"stylesheet\" href=\"https://unpkg.com/github-markdown-css\"\u003e\n  \u003carticle class=\"markdown-body\" style=\"padding: 2.5em\"\u003e\n    {{placeholder}}\n  \u003c/article\u003e\n```\n\n\u003e `{{placeholder}}` will be replaced with the result.\n\nThis configuration file is loaded through [cosmoconfig](https://github.com/davidtheclark/cosmiconfig#explorersearch), so you can place the corresponding file according to its rules, such as `~/.m2irc`.\n\n## Recipes\n\n### Code highlighting\n\nCode highlighting through [Prism](https://prismjs.com).\n\n.m2irc\n\n```yaml\nhtml: |\n  \u003clink rel=\"stylesheet\" href=\"https://unpkg.com/github-markdown-css\"\u003e\n  \u003clink rel=\"stylesheet\" href=\"https://unpkg.com/prismjs/themes/prism-okaidia.css\"\u003e\n  \u003carticle class=\"markdown-body\" style=\"padding: 2.5em\"\u003e{{placeholder}}\u003c/article\u003e\n  \u003cscript src=\"https://unpkg.com/prismjs\"\u003e\u003c/script\u003e\n```\n\n### Custom styles\n\n.m2irc\n\n```yaml\nhtml: |\n  \u003clink href=\"https://fonts.googleapis.com/css2?family=Noto+Sans+SC\u0026display=swap\" rel=\"stylesheet\"\u003e\n  \u003cstyle\u003e\n    :root {\n      --font-sans: 'Noto Sans SC', sans-serif;\n      --body-width: 45em;\n      --body-bg: #f3f2ee;\n      --body-color: #1f0909;\n    }\n    body {\n      margin: 0 auto;\n      padding: 3em 2.5em;\n      max-width: var(--body-width);\n      background: var(--body-bg);\n      color: var(--body-color);\n      font-family: var(--font-sans);\n    }\n    a {\n      color: var(--link-color);\n      text-decoration: none;\n    }\n  \u003c/style\u003e\n  \u003cdiv\u003e{{placeholder}}\u003c/div\u003e\n```\n\n## API Usage\n\n```javascript\nconst m2i = require('m2i')\n\n// readme.md =\u003e readme.png\nconst result = await m2i('./readme.md')\n// result =\u003e 'readme.png'\n\n// more options\nawait m2i('./readme.md', {\n  output: './foo.png', // output filename\n  width: 800, // viewport width\n  scale: 1 // device scale factor\n})\n```\n\n## References\n\n### m2i(input, options?)\n\n#### input\n\n- Type: `string`\n- Details: markdown file path\n\n#### options\n\n##### output\n\n- Type: `string`\n- Details: output image path\n- Default: `'\u003cinput_basename\u003e.png'`\n\n##### width\n\n- Type: `number`\n- Details: output image width, viewport width\n- Default: `600`\n\n##### scale\n\n- Type: `number`\n- Details: output image scale, device scale factor\n- Default: `2`\n\n##### pdf\n\n- Type: `boolean`\n- Details: pdf mode, output pdf file\n- Default: `false`\n\n## Related\n\n- [zce/m2i-server](https://github.com/zce/m2i-server) - A service to convert markdown to image.\n\n## Contributing\n\n1. **Fork** it on GitHub!\n2. **Clone** the fork to your own machine.\n3. **Checkout** your feature branch: `git checkout -b my-awesome-feature`\n4. **Commit** your changes to your own branch: `git commit -am 'Add some feature'`\n5. **Push** your work back up to your fork: `git push -u origin my-awesome-feature`\n6. Submit a **Pull Request** so that we can review your changes.\n\n\u003e **NOTE**: Be sure to merge the latest from \"upstream\" before making a pull request!\n\n## License\n\n[MIT](LICENSE) \u0026copy; [zce](https://zce.me)\n\n\n\n[actions-img]: https://img.shields.io/github/workflow/status/zce/m2i/CI\n[actions-url]: https://github.com/zce/m2i/actions\n[codecov-img]: https://img.shields.io/codecov/c/github/zce/m2i\n[codecov-url]: https://codecov.io/gh/zce/m2i\n[license-img]: https://img.shields.io/github/license/zce/m2i\n[license-url]: https://github.com/zce/m2i/blob/master/LICENSE\n[downloads-img]: https://img.shields.io/npm/dm/m2i\n[downloads-url]: https://npm.im/m2i\n[version-img]: https://img.shields.io/npm/v/m2i\n[version-url]: https://npm.im/m2i\n[dependency-img]: https://img.shields.io/david/zce/m2i\n[dependency-url]: https://david-dm.org/zce/m2i\n[devdependency-img]: https://img.shields.io/david/dev/zce/m2i\n[devdependency-url]: https://david-dm.org/zce/m2i?type=dev\n[style-img]: https://img.shields.io/badge/code_style-standard-brightgreen\n[style-url]: https://standardjs.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzce%2Fm2i-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzce%2Fm2i-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzce%2Fm2i-cli/lists"}