{"id":28226052,"url":"https://github.com/rh1tech/zoia-captcha","last_synced_at":"2026-05-15T14:05:14.901Z","repository":{"id":34158577,"uuid":"170715743","full_name":"rh1tech/zoia-captcha","owner":"rh1tech","description":"JIMP-based captcha image generator for Node.js","archived":false,"fork":false,"pushed_at":"2023-03-04T03:09:13.000Z","size":32,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T04:59:31.533Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rh1tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2019-02-14T15:44:23.000Z","updated_at":"2025-03-11T23:28:52.000Z","dependencies_parsed_at":"2025-02-28T08:56:28.227Z","dependency_job_id":"426d207f-5137-4a7c-ab28-54726c20fa74","html_url":"https://github.com/rh1tech/zoia-captcha","commit_stats":null,"previous_names":["rh1tech/zoia-captcha"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rh1tech/zoia-captcha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh1tech%2Fzoia-captcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh1tech%2Fzoia-captcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh1tech%2Fzoia-captcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh1tech%2Fzoia-captcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rh1tech","download_url":"https://codeload.github.com/rh1tech/zoia-captcha/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh1tech%2Fzoia-captcha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33068896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"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":"2025-05-18T11:10:12.558Z","updated_at":"2026-05-15T14:05:14.895Z","avatar_url":"https://github.com/rh1tech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zoia Captcha\n\nZoia Captcha (zoia-captcha) is a library for captcha generation based on JIMP (no external dependenices like ImageMagick or GD are required). \n\n## Usage\n\nFirst, install the latest version of *zoia-captcha* from NPM:\n\n`npm i zoia-captcha --save`\n\nThen you need to include *zoia-captcha* in your code:\n```javascript\nconst captcha = require('zoia-captcha');\n```\n*zoia-captcha* exports the following methods:\n```javascript\ngetCaptcha = async (code, backgroundChars = backgroundCharsDefault, backgroundColor = backgroudColorDefault)\n```\n* The mandatory parameter is *code* which represents a string which is displayed on the image\n* The first optional parameter is *backgroundChars* (default value is [...'0123456789']) which indicates which characters are displayed on the background as \"garbage\"\n* The second optional parameter is *backgroundColor* (default value is 0xFFFFFFFF) which indicates the background color of the captcha image (it's not recommended to set the opacity to 00 as it makes easier to recognize the captcha image)\n\nThe method *getCaptcha* returns a promise and resolves a binary image buffer.\n\n## Examples\n\nTo save the result image to a file, you may use the following code:\n```javascript\nconst zcaptcha = require('zoia-captcha');\nconst fs = require('fs');\nconst test = async() =\u003e {\n\tconst img = await zcaptcha.getCaptcha('1234');\n\tfs.writeFileSync('image.png', img);\n};\ntest();\n```\nIn the following example there is a 4-digit captcha is returned as an *Express* route:\n```javascript\nconst getCaptcha = async (req, res) =\u003e {\n    const code = Math.random().toString().substr(2, 4);\n    const image = await captcha.getCaptcha(code);\n    res.writeHead(200, {\n        'Content-Type': 'image/png'\n    });\n    return res.end(image, 'binary');\n};\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frh1tech%2Fzoia-captcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frh1tech%2Fzoia-captcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frh1tech%2Fzoia-captcha/lists"}