Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fs readfile promise

var Promise = require('bluebird');
var fs = Promise.promisifyAll(require('fs'));

 function getImage(index) {
     var imgPath = __dirname + "/image1" + index + ".png";
     return fs.readFileAsync(imgPath);
 }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #fs #readfile #promise
ADD COMMENT
Topic
Name
1+5 =