tidy examples a little

This commit is contained in:
Luke Page 2015-08-05 23:37:30 +01:00
parent f84416a523
commit cdd6f0c5ab
3 changed files with 12 additions and 9 deletions

View file

@ -1,8 +1,8 @@
var fs = require('fs'),
PNG = require('pngjs').PNG;
PNG = require('../lib/png').PNG; // note require('pngjs') outside this project
fs.createReadStream('in.png')
fs.createReadStream('test/in/basi0g01.png')
.pipe(new PNG({
filterType: 4
}))

10
examples/newfile.js Normal file
View file

@ -0,0 +1,10 @@
var PNG = require("../lib/png").PNG;
(new PNG({width:1,height:1})).pack()
.on('data', function(data) {
console.log('data', data);
})
.on('end', function() {
console.log('bitmap:', this.data);
console.log('end !');
});

View file

@ -1,7 +0,0 @@
var PNG = require("../lib/png").PNG;
(new PNG({width:1,height:1})).pack()
.on("end", function() {
console.log(this.data);
console.log("end !"); // never called
})