Socket
Socket
Sign inDemoInstall

kaptcha

Package Overview
Dependencies
14
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

kaptcha.js

2

package.json
{
"name": "kaptcha",
"version": "1.0.0",
"version": "1.0.1",
"description": "simple 6 digit captcha image middleware for express, modified from captcha middleware.",

@@ -5,0 +5,0 @@ "main": "kaptcha.js",

# kaptcha
simple 6 digit captcha image middleware for express, modified from captcha middleware
## Installation
Canvas is required, please follow canvas instruction to install canvase dependencies. [Canvas@npmjs](https://www.npmjs.com/package/canvas)
Once canvas is installed successfully, run npm command to install kaptcha.
```
npm install kaptcha
```
## Usage
Mount kaptcha middleware:
```
var kaptcha = require('kaptcha');
app.use(kaptcha({ url: '/kaptcha.jpg', color: 'rgb(0, 0, 0)', background: 'rgb(255, 255, 255)' width: 100, height: 30, save: function(code) { console.log(code); } }));
```
## Parameters
### url
url to render captcha image.
### color
font color
### background
background color
### width
image width
### height
image height
### save
Optional callback to receive generated random digit, or kaptcha will try to save it to req.session.captcha .
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc