{"id":36540279,"url":"https://github.com/luoxuhai/generator-cover","last_synced_at":"2026-01-12T05:45:06.450Z","repository":{"id":57246815,"uuid":"206331523","full_name":"luoxuhai/generator-cover","owner":"luoxuhai","description":"中文图书封面生成器 Chinese book cover generator","archived":false,"fork":false,"pushed_at":"2020-10-25T13:26:26.000Z","size":605,"stargazers_count":28,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-25T16:26:13.546Z","etag":null,"topics":["image","javascript","nodejs","npm-module"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/generator-cover","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/luoxuhai.png","metadata":{"files":{"readme":"README.en.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}},"created_at":"2019-09-04T13:55:03.000Z","updated_at":"2025-06-15T05:04:43.000Z","dependencies_parsed_at":"2022-08-24T16:31:40.260Z","dependency_job_id":null,"html_url":"https://github.com/luoxuhai/generator-cover","commit_stats":null,"previous_names":["ibyli/generator-cover"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/luoxuhai/generator-cover","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxuhai%2Fgenerator-cover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxuhai%2Fgenerator-cover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxuhai%2Fgenerator-cover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxuhai%2Fgenerator-cover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luoxuhai","download_url":"https://codeload.github.com/luoxuhai/generator-cover/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxuhai%2Fgenerator-cover/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["image","javascript","nodejs","npm-module"],"created_at":"2026-01-12T05:45:01.684Z","updated_at":"2026-01-12T05:45:06.438Z","avatar_url":"https://github.com/luoxuhai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"- English\n- [简体中文](https://github.com/ibyli/generator-cover/blob/master/README.md)\n\n**Used to quickly generate Chinese book covers**\n\n\u003cp  align=\"center\"\u003e \n  \u003ca href=\"https://github.com/ibyli/generator-cover/blob/master/LICENSE\"\u003e\n    \u003cimg height=\"28px\" alt=\"License\" src=\"http://img.shields.io/badge/license-mit-blue.svg?style=for-the-badge\" style=\"max-width:100%;\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\n**! Please install before use [ node-canvas](https://github.com/Automattic/node-canvas)**\n\n```c\n  $ npm install generator-cover --save\n   or\n  $ yarn add generator-cover\n   or\n  $ cnpm install generator-cover --save\n```\n\n## Docs\n\n| attribute |             type             |          default          | required |                            explain                             |\n| :-------: | :--------------------------: | :-----------------------: | :------: | :------------------------------------------------------------: |\n| bookName  |            String            |                           |   yes    |                             title                              |\n| fontColor |            Color             |         \"#FFFFFF\"         |    no    |    font color(Gradient color is not supported at this time)    |\n| fontStyle |            String            | '74px \"Source Han Serif\"' |    no    |  The property uses the same syntax as the CSS font property。  |\n|  bgColor  |            Color             |         \"#000000\"         |    no    | background color(Gradient color is not supported at this time) |\n|  bgImage  | local file/remote URL/base64 |                           |    no    |                        Background image                        |\n| savePath  |             Path             |        \\_\\_dirname        |    no    |                         File save path                         |\n| fileName  |            String            |      Date.now().jpg       |    no    |                         File save name                         |\n|  quality  |            Number            |             1             |    no    |                     Output quality(0 - 1)                      |\n|   font    |            Object            |                           |    no    |          Custom font font file name cannot be Chinese          |\n|   width   |            Number            |          470(px)          |    no    |                        Cover the width                         |\n|  height   |            Number            |          750(px)          |    no    |                        Cover the height                        |\n|   left    |            Number            |          90(px)           |    no    |                      Left margin of title                      |\n\n## Examples\n\n```javascript\n'use strict';\n\nconst generatorCover = require('generator-cover');\n\ngeneratorCover({\n  bookName: '醒世姻缘传',\n  fontStyle: '74px \"Source Han Serif\"',\n  bgColor: '#BCE3E7',\n  fontColor: '#4A70A9',\n  fileName: '醒世姻缘传.png',\n  savePath: __dirname,\n  quality: 1,\n  width: 470,\n  height: 750,\n  left: 90\n  // font: {\n  //   fontPath: 'fontPath',\n  //   family: 'fontFamily'\n  // },\n}).then(res =\u003e {\n  console.log('cover path:', res);\n});\n```\n\n## License\n\n[MIT](https://github.com/ibyli/generator-cover/blob/master/LICENSE)\n\nCopyright (c) 2019-present, [ibyli](https://github.com/ibyli/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoxuhai%2Fgenerator-cover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluoxuhai%2Fgenerator-cover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoxuhai%2Fgenerator-cover/lists"}