{"id":25944832,"url":"https://github.com/raoul1996/egg-captcha","last_synced_at":"2025-03-04T08:19:22.122Z","repository":{"id":29777462,"uuid":"122723780","full_name":"Raoul1996/egg-captcha","owner":"Raoul1996","description":"captcha plugin for egg, based on ccap","archived":false,"fork":false,"pushed_at":"2023-01-23T20:38:30.000Z","size":2657,"stargazers_count":19,"open_issues_count":18,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T04:29:05.969Z","etag":null,"topics":["captcha","ccap","egg-plugin"],"latest_commit_sha":null,"homepage":null,"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/Raoul1996.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}},"created_at":"2018-02-24T09:13:49.000Z","updated_at":"2022-02-26T22:07:28.000Z","dependencies_parsed_at":"2023-02-13T03:00:16.338Z","dependency_job_id":null,"html_url":"https://github.com/Raoul1996/egg-captcha","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raoul1996%2Fegg-captcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raoul1996%2Fegg-captcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raoul1996%2Fegg-captcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raoul1996%2Fegg-captcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Raoul1996","download_url":"https://codeload.github.com/Raoul1996/egg-captcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241809532,"owners_count":20023787,"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":["captcha","ccap","egg-plugin"],"created_at":"2025-03-04T08:19:20.970Z","updated_at":"2025-03-04T08:19:22.111Z","avatar_url":"https://github.com/Raoul1996.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# egg-captcha\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/egg-captcha.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-captcha\n[travis-image]: https://img.shields.io/travis/raoul1996/egg-captcha.svg?style=flat-square\n[travis-url]: https://travis-ci.org/raoul1996/egg-captcha\n[codecov-image]: https://img.shields.io/codecov/c/github/raoul1996/egg-captcha.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/raoul1996/egg-captcha?branch=master\n[david-image]: https://img.shields.io/david/raoul1996/egg-captcha.svg?style=flat-square\n[david-url]: https://david-dm.org/raoul1996/egg-captcha\n[snyk-image]: https://snyk.io/test/npm/egg-captcha/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/egg-captcha\n[download-image]: https://img.shields.io/npm/dm/egg-captcha.svg?style=flat-square\n[download-url]: https://npmjs.org/package/egg-captcha\n\n\u003e captcha plugin for egg framework, based on [ccap](https://www.npmjs.com/package/ccap)\n\u003c!--\nDescription here.\n--\u003e\n\n## Install\n\n```bash\n$ npm i egg-captcha --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\n\nexports.captcha = {\n  enable: true,\n  package: 'egg-captcha',\n};\n```\n## Configuration\n\n```js\n// {app_root}/config/config.default.js\n\nexports.captcha = {\n  width: 256, // set width,default is 256\n  height: 60, // set height,default is 60\n  offset: 40, // set text spacing,default is 40\n  quality: 100, // set pic quality,default is 50\n  fontsize: 57 // set font size,default is 57\n}\n```\nsee [config/config.default.js](config/config.default.js) for more detail.\n\n## Example\n\n```js\n// {app_root}/controller/user.js\n\nasync captcha() {\n  const {ctx, service} = this\n  const {captcha, txt} = await service.user.captcha()\n  ctx.body = captcha\n  ctx.type = 'image/png'\n  // need open the egg-session plugin\n  ctx.session.captcha = txt\n}\n```\n```js\n// {app_root}/service/user.js\n\nasync captcha() {\n  const {app} = this\n  const ary = app.captcha.generate()\n  return {captcha: ary[1], txt: ary[0]}\n}\n```\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraoul1996%2Fegg-captcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraoul1996%2Fegg-captcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraoul1996%2Fegg-captcha/lists"}