2.0.3 • Published 10 years ago
naptcha v2.0.3
Introduction
A simple captcha for Node.js, support node 0.10.x, 0.12.x, 4.x and 5.0. Support Mac OS X and Linux.
How to build
Make sure install nodejs before building.
$ npm run buildRun demo
$ npm run demoInstallation
Install ImageMagick before install naptcha on Linux.
$ apt-get install ImageMagick$ npm install naptchaExamples
express.js
var naptcha = require('naptcha').of();
app.get('/naptcha', function (req, res) {
var nap = naptcha.perform();
res.setHeader("Content-Type", "image/jpeg");
res.end(nap.bytes, 'binary');
});koa.js
router.get('/naptcha', function* (req, resp) {
const nap = naptcha.perform();
this.session.naptcha = nap.text;
this.body = nap.bytes;
this.type = 'image/jpeg';
});Release History
- 1.3.1
- stable version
- 2.0.0
- change api for get image bytes by
nap.bytes - add cache for captcha
- change api for get image bytes by
- 2.0.3
- fix cache dispose issue
- stable version
License
MIT
2.0.3
10 years ago
2.0.2
10 years ago
2.0.1
10 years ago
2.0.0
10 years ago
1.3.1
10 years ago
1.2.10
10 years ago
1.2.9
10 years ago
1.2.8
10 years ago
1.2.7
10 years ago
1.2.6
10 years ago
1.2.5
10 years ago
1.2.4
10 years ago
1.2.3
10 years ago
1.2.2
10 years ago
1.2.1
10 years ago
1.2.0
10 years ago
1.1.0
10 years ago
1.0.4
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago