Examples: Move away from using a symlink to be able to require('paper') from within examples.

- Node 5 / NPM 3 struggles with it
- It never worked on Windows
This commit is contained in:
Jürg Lehni 2016-01-29 23:06:31 +01:00
parent e4ece39603
commit e232ebc443
10 changed files with 41 additions and 17 deletions

View file

@ -1,4 +1,7 @@
var paper = require('paper');
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
var paper = require('../../dist/paper-full.js');
paper.setup(new paper.Size(1024, 768));
var layer = paper.project.activeLayer;

View file

@ -1,5 +1,8 @@
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
var paper = require('../../dist/paper-full.js');
var http = require('http');
var paper = require('paper');
http.createServer(function(request, response) {
var canvas = paper.createCanvas(800, 800);

View file

@ -1,6 +1,9 @@
var paper = require('paper'),
path = require('path'),
fs = require('fs');
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
var paper = require('../../dist/paper-full.js');
var path = require('path');
var fs = require('fs');
var canvas = paper.createCanvas(612, 792, 'pdf');
paper.setup(canvas);

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,7 @@
var paper = require('paper');
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
var paper = require('../../dist/paper-full.js');
var fs = require('fs');
var canvas = paper.createCanvas(800, 600);

View file

@ -1,6 +1,9 @@
var paper = require('paper'),
path = require('path'),
fs = require('fs');
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
var paper = require('../../dist/paper-full.js');
var path = require('path');
var fs = require('fs');
with (paper) {
paper.setup(new Size(300, 600));

View file

@ -1,9 +1,12 @@
var paper = require('paper'),
path = require('path'),
fs = require('fs');
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
var paper = require('../../dist/paper-full.js');
var path = require('path');
var fs = require('fs');
paper.setup(new paper.Size(300, 600));
paper.project.importSVG('file://' + path.resolve(__dirname, 'in.svg'), {
paper.project.importSVG(/*'in.svg'*/'file://' + path.resolve(__dirname, 'in.svg'), {
onLoad: function(item) {
paper.view.exportFrames({
amount: 1,

View file

@ -1,4 +1,7 @@
var paper = require('paper');
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
var paper = require('../../dist/paper-full.js');
var scope = require('./Tadpoles.pjs')(new paper.Size(1024, 768));
scope.view.exportFrames({

1
node_modules/paper generated vendored
View file

@ -1 +0,0 @@
../

View file

@ -15,7 +15,8 @@
],
"main": "dist/paper-full.js",
"scripts": {
"lint": "jshint src"
"lint": "jshint src",
"prepublish": "gulp build"
},
"files": [
"AUTHORS.md",