Commit 64134797 authored by Ryan LeFevre's avatar Ryan LeFevre

Do promises properly in example

parent 2b34c6fa
...@@ -2,8 +2,9 @@ var PSD = require('../'); ...@@ -2,8 +2,9 @@ var PSD = require('../');
var file = process.argv[2] || './examples/images/example.psd'; var file = process.argv[2] || './examples/images/example.psd';
var start = new Date(); var start = new Date();
psd = PSD.open(file).then(function (psd) {
psd.image.saveAsPng('./output.png').then(function () { PSD.open(file).then(function (psd) {
console.log("Finished in " + ((new Date()) - start) + "ms"); return psd.image.saveAsPng('./output.png');
}); }).then(function () {
}); console.log("Finished in " + ((new Date()) - start) + "ms");
\ No newline at end of file });;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment