# node-svgcaptcha

> SVG captcha generator

Latest version **1.0.1** (published 2015-01-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-svgcaptcha
pnpm add node-svgcaptcha
yarn add node-svgcaptcha
bun add node-svgcaptcha
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-01-01 |
| First published | 2015-01-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ezequiel Rubio |
| Maintainers | erubio |
| Keywords | captcha, svg |

## Links

- npm: https://www.npmjs.com/package/node-svgcaptcha
- npm.io page: https://npm.io/package/node-svgcaptcha

## Recent versions

- 1.0.1 (latest) — 2015-01-01
- 1.0.0 — 2015-01-01

## README

node-svgcaptcha
===============

A npm module to generate a captcha with svg image


How to use:
================
Install npm package:

	npm install node-svgcaptcha
	
In your code:

	app.get('/captcha', function(req, res){

		var captcha = require('node-svgcaptcha');
		var options = {};//Set your configuration in this object
		var genCaptcha = captcha(options);
		
		if(req.session){//save value in session
			req.session.captcha = genCaptcha.captchaValue;
		}
		
		//return svg to render in the browser
		res.set('Content-Type', 'image/svg+xml');
		res.send(genCaptcha.svg);	
	});


Options:
===============
	  Options that we can pass to the module with the default values:
	  
	  values: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' // String with chars to generate random captcha
		length: 8 // lenght of chars in generated captcha
		width: 200 // width of the generated image
		height: 50 // height of the generated image
		color: true // true means that letters are painted in colors and false in gray scale
		lines: 2 // number of lines in the captcha
		noise: 1 // level of noise (points) in the captcha

---
_Source: https://npm.io/package/node-svgcaptcha · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
