captcha-image
Advanced tools
Comparing version 1.2.1 to 1.2.2
{ | ||
"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="..." /> | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4114
71