Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 1.1.0 to 1.2.0

5

index.js
class Captcha {
constructor(font, align, baseline, width, height, bgColor, color) {
let code;
this.font = font;

@@ -10,2 +11,5 @@ this.align = align;

this.bgColor = bgColor;
this.getCode = () => {
return code;
};
this.createImage = () => {

@@ -42,2 +46,3 @@ const captcha = document.createElement('canvas');

const newWord = getWord();
code = getWord();
const context = captcha.getContext('2d');

@@ -44,0 +49,0 @@ context.canvas.width = this.width;

2

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

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

@@ -14,3 +14,3 @@ # Captcha Image Generator

```js
import Captcha from './Captcha';
import Captcha from './captcha-image';

@@ -36,2 +36,3 @@ const captchaImage = new Captcha(

function App() {
console.log(captchaImage.getCode());
return (

@@ -51,9 +52,9 @@ <div className='App'>

- [font](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font): '35px Arial'
- [align](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign): 'center'
- [baseline](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textBaseline): 'middle
- width: 300
- height: 150
- bgColor: #eee
- color: #222
- [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

@@ -63,1 +64,2 @@ ## Events

- createImage() method return HTML element parsed as String
- getCode() method return generate code as String
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc