
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Generate captcha image. Written in Node.js.
Node-captchar requires canvas, pleace follow canvas's installation wiki to install dependencies.
var captchar = require('captchar')
captchar()
.then(function (data) {
console.log(data)
})
/*
{
src: '/PATH/TO/PROJECT/.captchar/73f1b787f3f125d8091b3a640343d4de.png,
code: 'TyK2'
}
*/
captchar({ format: 'datauri' })
.then(function (data) {
console.log(data)
})
/*
{
src: 'data:image/png',
code: '5HPp'
}
*/
captchar({ format: 'stream' })
.then(function (data) {
console.log(data)
})
/*
{
src:
{
sync: undefined,
canvas: [Canvas 80x30],
readable: true,
_events: {}
},
code: 'jF4i'
}
*/
captchar({
width: 80,
height: 30,
fontSize: 22,
fontFamily: 'Times New Roman',
textLength: 4, // dummy character is not included
backgroundColor: '#fff',
outputDir: process.cwd()) + '/.captchar/',
imageName: md5(Date.now().toString())) + '.png', // do not pass .png; recommend to generate image name manually
format: 'fs', // 'stream', or 'datauri'. otherwise, out to `disk`
pool: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
dummy: true // set to `false` to turn dummy off
})
Example with default options:
The real code is 5HPp
, o
is dummy.
FAQs
Generate captcha image. Written in Node.js.
The npm package captchar receives a total of 3 weekly downloads. As such, captchar popularity was classified as not popular.
We found that captchar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.