{"id":16326680,"url":"https://github.com/chrisyip/node-captchar","last_synced_at":"2025-10-25T20:32:10.322Z","repository":{"id":18326051,"uuid":"21505150","full_name":"chrisyip/node-captchar","owner":"chrisyip","description":"Generate captcha image. Written in Node.js.","archived":false,"fork":false,"pushed_at":"2015-03-02T10:16:39.000Z","size":145,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T10:26:02.004Z","etag":null,"topics":[],"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/chrisyip.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}},"created_at":"2014-07-04T18:35:48.000Z","updated_at":"2021-12-10T06:54:53.000Z","dependencies_parsed_at":"2022-08-25T13:01:05.855Z","dependency_job_id":null,"html_url":"https://github.com/chrisyip/node-captchar","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fnode-captchar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fnode-captchar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fnode-captchar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fnode-captchar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisyip","download_url":"https://codeload.github.com/chrisyip/node-captchar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238207648,"owners_count":19434095,"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":[],"created_at":"2024-10-10T23:09:16.831Z","updated_at":"2025-10-25T20:32:05.032Z","avatar_url":"https://github.com/chrisyip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Captchar\n\n[![Node version][node-image]][npm-url] [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url]\n\nGenerate captcha image. Written in Node.js.\n\n## Installation\n\nNode-captchar requires [canvas](https://www.npmjs.org/package/canvas), pleace follow canvas's installation [wiki](https://github.com/LearnBoost/node-canvas/wiki/_pages) to install dependencies.\n\n## Features\n\n- Background noises\n- Support dummy character (presented in red color)\n- Customizable string pool\n\n## Usage\n\n```js\nvar captchar = require('captchar')\n\ncaptchar()\n    .then(function (data) {\n        console.log(data)\n    })\n/*\n{\n    src: '/PATH/TO/PROJECT/.captchar/73f1b787f3f125d8091b3a640343d4de.png,\n    code: 'TyK2'\n}\n */\n\ncaptchar({ format: 'datauri' })\n    .then(function (data) {\n        console.log(data)\n    })\n/*\n{\n    src: 'data:image/png',\n    code: '5HPp'\n}\n */\n\ncaptchar({ format: 'stream' })\n    .then(function (data) {\n        console.log(data)\n    })\n/*\n{\n    src:\n        {\n            sync: undefined,\n            canvas: [Canvas 80x30],\n            readable: true,\n            _events: {}\n        },\n    code: 'jF4i'\n}\n */\n```\n\n## Options\n\n```js\ncaptchar({\n    width: 80,\n    height: 30,\n    fontSize: 22,\n    fontFamily: 'Times New Roman',\n    textLength: 4, // dummy character is not included\n    backgroundColor: '#fff',\n    outputDir: process.cwd()) + '/.captchar/',\n    imageName: md5(Date.now().toString())) + '.png', // do not pass .png; recommend to generate image name manually\n    format: 'fs', // 'stream', or 'datauri'. otherwise, out to `disk`\n    pool: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',\n    dummy: true // set to `false` to turn dummy off\n})\n```\n\nExample with default options:\n\n![](http://f.cl.ly/items/133L2t3x1S0a2F1I1i24/Unknown.png)\n\nThe real code is `5HPp`, `o` is dummy.\n\n## Contributors\n\n- [Chris Yip](https://github.com/chrisyip/node-captchar/commits/master?author=chrisyip)\n\n[node-image]: http://img.shields.io/node/v/captchar.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/node-captchar\n[npm-image]: http://img.shields.io/npm/v/captchar.svg?style=flat-square\n[daviddm-url]: https://david-dm.org/chrisyip/node-captchar\n[daviddm-image]: http://img.shields.io/david/chrisyip/node-captchar.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fnode-captchar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisyip%2Fnode-captchar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fnode-captchar/lists"}