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

drawable

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drawable - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.travis.yml

14

package.json
{
"name": "drawable",
"version": "0.1.0",
"version": "0.1.1",
"description":
"A way to make styling canvas elements like text and images nicer",
"main": "index.js",
"main": "dist/index.js",
"author": "Jacob Lowe",

@@ -11,12 +11,16 @@ "license": "MIT",

"build": "babel src --out-dir dist",
"watch": "babel src --out-dir dist --watch"
"watch": "babel src --out-dir dist --watch",
"test": "npm run build && ava tests/*.test.js",
"prepublish": "npm run build"
},
"dependencies": {
"canvas": "2.0.0-aplha.4",
"canvas": "2.0.0-alpha.4",
"image-size": "^0.6.1"
},
"devDependencies": {
"ava": "^0.22.0",
"babel-cli": "^6.26.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0"
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"mock-require": "^2.0.2"
}
}

@@ -8,3 +8,3 @@ # Drawable

```
npi i drawable --save
npm i drawable --save
```

@@ -17,3 +17,3 @@

const drawable = new Drawable({ width: 200, height: 200 });
const drawable = new Drawable({ width: 200, height: 200, backgroundColor: 'white' });

@@ -35,1 +35,8 @@ drawable.addFont('../font/path.ttf', 'Fake font');

```
## TODO
- make api work on both client and server
- solidify output methods `toBuffer` and `toDataURI`
- make a public way to expose canvas element ( for appending to DOM )
- make a few adapters to work with react and ember

@@ -13,3 +13,3 @@ import Canvas from 'canvas';

const { width, height } = this._options;
this._canvas = createCanvas(width, height);
this._canvas = createCanvas(width || 0, height || 0);
this._context = this._canvas.getContext('2d');

@@ -42,3 +42,2 @@ }

this._children = this._children.concat(elements);
console.log(this._children);
if (lazy || !elements.length) return Promise.resolve();

@@ -50,3 +49,3 @@ return this.draw();

registerFont(path, { family });
this.createCanvas(); // need to recreate canvas afte registering font
this.createCanvas(); // need to recreate canvas after registering font
}

@@ -53,0 +52,0 @@

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