Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/trekjs/captcha

A Lightweight Pure JavaScript Captcha for Node.js. No C/C++, No ImageMagick, No Canvas.
https://github.com/trekjs/captcha

captcha pure-javascript

Last synced: 1 day ago
JSON representation

A Lightweight Pure JavaScript Captcha for Node.js. No C/C++, No ImageMagick, No Canvas.

Awesome Lists containing this project

README

        

# captcha

A Lightweight Pure JavaScript Captcha for Node.js. No C/C++, No ImageMagick, No canvas. Inspired By [rucaptcha](https://github.com/huacnlee/rucaptcha).

## Installation

```
$ npm install trek-captcha --save
```

## Examples

```js
'use strict'

const fs = require('fs')
const captcha = require('trek-captcha')

async function run() {
const { token, buffer } = await captcha()

// console.log(token, buffer)

fs.createWriteStream('a.gif').on('finish', () => console.log(token)).end(buffer)
}

run()
```

## API

`captcha({ size: 5, style: -1 })`

* **size**: Defaults to 5.
* **style**: Defaults to -1 with random.

```js
// returns
{
token,
buffer
}
```

## Badges

[![Linux](https://travis-ci.org/trekjs/captcha.svg?branch=master)](https://travis-ci.org/trekjs/captcha)
[![Windows](https://img.shields.io/appveyor/ci/fundon/captcha/master.svg?label=windows)](https://ci.appveyor.com/project/fundon/captcha)
[![codecov](https://codecov.io/gh/trekjs/captcha/branch/master/graph/badge.svg)](https://codecov.io/gh/trekjs/captcha)
![](https://img.shields.io/badge/license-MIT-blue.svg)

---

> [fundon.me](https://fundon.me)  · 
> GitHub [@fundon](https://github.com/fundon)  · 
> Twitter [@_fundon](https://twitter.com/_fundon)