Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including easy-captcha with all npm packages installed. Try it out:

var easyCaptcha = require("easy-captcha")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

easy-captcha v0.0.5

Easily add captcha to forms

var captcha = require('captcha');

app.use('/captcha.jpg',captcha({width:256,height:60,offset:40, quality:30,attempts:3}));

app.post('/form', captcha.check, function (req,res,next) { //returns true is valid - the captcha value must sent in the captch field //the error message is in the errDesc key of the captcha object res.send(req.session.captcha.valid); });

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free