Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

image-raub

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-raub - npm Package Compare versions

Comparing version 0.0.5 to 0.1.0

31

js/image.js

@@ -10,3 +10,3 @@ 'use strict';

class JsImage extends EventEmitter {
class JsImage extends Image {

@@ -17,6 +17,2 @@ constructor(src) {

this.emit = this.emit.bind(this);
this._image = new Image(this);
this._complete = false;

@@ -41,2 +37,6 @@ this._src = '';

addEventListener(type, cb) {
this.on(type, cb.bind(this));
}
on(name, cb) {

@@ -49,10 +49,15 @@ super.on(name, cb);

once(name, cb) {
super.once(name, cb);
if (name === 'load' && this._complete) {
cb.call(this);
}
}
get complete() { return this._complete; }
get data() { return this._complete ? this._image.data : null; }
get data() { return this._complete ? this.data : null; }
get width() { return this._complete ? this._image.width : 0; }
get height() { return this._complete ? this._image.height : 0; }
get naturalWidth() { return this.width; }

@@ -81,3 +86,3 @@ get naturalHeight() { return this.height; }

}
this._image.load(data);
this.load(data);
});

@@ -88,7 +93,2 @@

addEventListener(type, cb) {
this.on(type, cb.bind(this));
}
get onerror() { return this.listeners('error'); }

@@ -104,5 +104,2 @@ set onerror(cb) { this.on('error', cb); }

save(dest, w, h) { return this._image.save(dest, w, h); }
}

@@ -109,0 +106,0 @@

{
"author": "Luis Blanco <luisblanco1337@gmail.com>",
"name": "image-raub",
"version": "0.0.5",
"version": "0.1.0",
"description": "Native Image loader for Node.js",

@@ -6,0 +6,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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