mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 10:47:59 +08:00
fixes for NodeJS env
This commit is contained in:
22
konva-node/index.js
Normal file
22
konva-node/index.js
Normal file
@@ -0,0 +1,22 @@
|
||||
var Konva = require('konva-dev');
|
||||
|
||||
var Canvas = require('canvas');
|
||||
|
||||
Konva.window = {
|
||||
Image: Canvas.Image,
|
||||
devicePixelRatio: 1
|
||||
};
|
||||
Konva.document = {
|
||||
createElement: function() {},
|
||||
documentElement: {
|
||||
addEventListener: function() {}
|
||||
}
|
||||
};
|
||||
// Konva.window = new JSDOM(
|
||||
// '<!DOCTYPE html><html><head></head><body></body></html>'
|
||||
// ).window;
|
||||
// Konva.document = Konva.window.document;
|
||||
// Konva.window.Image = Canvas.Image;
|
||||
Konva._nodeCanvas = Canvas;
|
||||
|
||||
module.exports = Konva;
|
31
konva-node/package.json
Normal file
31
konva-node/package.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "konva-node",
|
||||
"version": "0.5.0",
|
||||
"description": "Konva framework for NodeJS env",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"typings": "./node_modules/konva/konva.d.ts",
|
||||
"scripts": {},
|
||||
"keywords": [
|
||||
"canvas",
|
||||
"animations",
|
||||
"graphic",
|
||||
"html5"
|
||||
],
|
||||
"author": "Anton Lavrenov",
|
||||
"bugs": {
|
||||
"url": "https://github.com/konvajs/konva/issues"
|
||||
},
|
||||
"homepage": "http://konvajs.github.io/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/konvajs/konva.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"canvas": "^1.6.7",
|
||||
"konva": "^1.7.0"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user