🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

captcha-image

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

captcha-image - npm Package Compare versions

Comparing version

to
1.2.2

2

package.json
{
"name": "captcha-image",
"version": "1.2.1",
"version": "1.2.2",
"description": "A simple captcha image generator.",

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

@@ -7,10 +7,37 @@ # Captcha Image Generator

Use `npm run captcha-image` or `yarn captcha-image` to install the package
- `npm run captcha-image`
- `yarn captcha-image`
## Usage
## Options
You can pass following parameters to Captcha instance in order to generate custom Captcha image
| Attributes | Values |
| ----------------------------------------------------------------------------------------------------------- | ------------ |
| [font](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font) / String | '35px Arial' |
| [align](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign) / String | 'center' |
| [baseline](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textBaseline) / String | 'middle |
| width / Number | 300 |
| height / Number | 150 |
| bgColor / String | #eee |
| color / String | #222 |
## Events
- createImage() method return HTML element parsed as String
## Output
Final outcome looks like this:
```html
<img src="..." data-key="..." />
```
## Demo Usage
### React
```js
import Captcha from './captcha-image';
import Captcha from 'captcha-image';

@@ -45,25 +72,1 @@ const captchaImage = new Captcha(

```
## Options
You can pass following parameters to Captcha instance in order to generate custom Captcha image
- [font] / String: (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font): '35px Arial'
- [align] / String: (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign): 'center'
- [baseline] / String: (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textBaseline): 'middle
- width / Number: 300
- height / Number: 150
- bgColor / String: #eee
- color / String: #222
## Events
- createImage() method return HTML element parsed as String
## Output
Final outcome looks like this:
```html
<img src="..." data-key="..." />
```