# node-gm-captcha

> use gm to create chaptcha number and image simply

Latest version **1.0.8** (published 2018-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-gm-captcha
pnpm add node-gm-captcha
yarn add node-gm-captcha
bun add node-gm-captcha
```

## 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.8 |
| Published | 2018-04-01 |
| First published | 2017-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | xhmm |
| Maintainers | xhmm |
| Keywords | captcha, gm |

## Links

- npm: https://www.npmjs.com/package/node-gm-captcha
- Repository: https://github.com/xhmm/node-gm-captcha
- Homepage: https://github.com/xhmm/node-gm-captcha#readme
- Issues: https://github.com/xhmm/node-gm-captcha/issues
- npm.io page: https://npm.io/package/node-gm-captcha

## Dependencies (1)

- [gm](https://npm.io/package/gm.md) 1.23.1

## Recent versions

- 1.0.8 (latest) — 2018-04-01
- 1.0.7 — 2018-04-01
- 1.0.6 — 2018-04-01
- 1.0.5 — 2017-10-15
- 1.0.4 — 2017-08-24
- 1.0.3 — 2017-08-24
- 1.0.2 — 2017-08-24
- 1.0.1 — 2017-08-24
- 1.0.0 — 2017-08-24

## README

## Pre
1. this project is still on working , its functionalities are not finally completed.
2. it now just support number captcha and has many limitations.
## installation
1. install [`Graphics Magick`](http://www.graphicsmagick.org/index.html) and make sure it can work on your computer.
2. npm i node-gm-captcha
## usage
```
let Captcha = require('node-gm-captcha');
Captcha.genPic({type:'num',filename:'./uniqueid.jpg'},(err,data)=>{
    if(err) throw err;
    console.log(data);
})
```
As the example above , you will get an image named 'uniqueid.jpg' under your project folder.
And the data will include some data you need , such as the number , filepath , with these , you can do your business logic.

## doc
### genPic(param:object , callback:fn):void
1. param

    | key | type | required | desc |
    | --- | --- | --- | --- |
    | type |  string | yes | it now only can set to 'num' |
    | filename| string | yes |where to store the pic , it should be relative path |
    | fontSize | number | no | the font size |
    | w |number | no | the width of the picture |
    | h | number | no | the height of the picture |
2. callback: `function(err , data:metaData){ }`

## Todo
- [ ] make the pic more complex from recognizing
- [ ] support char type capthcha
- [ ] support mix type(char and number) captcha
- [ ] add delete method so you can easily delete the pic
- [ ] expose more customized params and method

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