Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

captcha

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

captcha

Simple captcha middleware for Connect

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-41.67%
Maintainers
1
Weekly downloads
 
Created
Source

Captcha

Simple captcha.

Installation

via npm:

$ npm install captcha

Application init:

...
var captcha = require('captcha');
...
app.configure(function(){
...
	app.use(app.router);
	app.use(captcha('/captcha.jpg')); // url for captcha jpeg
	app.use(express.static(__dirname + '/public'));
...

Color Options

You can setup colors with an object, instead of just URL, like this (CSS-notation of color):

...
app.use(captcha({ url: '/captcha.jpg', color:'#0064cd', background: 'rgb(20,30,2}));
...

All color options are optional.

Render captcha:

<img src="/captcha.jpg" />

Check captcha:

app.post('/user/create', function(req, res, next){
	if(req.body.captcha != req.session.captcha) // text from captcha stored into session
		return next(new Error('Captcha stop!'));
...

PS: thanks for more detailed description: http://stackoverflow.com/questions/9487844/nodejs-how-to-use-node-captcha-module

FAQs

Package last updated on 24 Nov 2012

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc