mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-23 12:45:48 +00:00
Replacing Streams interface for FS.readFile to load assets in the Node.js module
This commit is contained in:
parent
78dc27a029
commit
67d1a4732c
1 changed files with 8 additions and 8 deletions
16
src/node.js
16
src/node.js
|
|
@ -58,14 +58,14 @@
|
|||
|
||||
/** @private */
|
||||
function request_fs(url, callback){
|
||||
var fs = require('fs'),
|
||||
stream = fs.createReadStream(url),
|
||||
body = '';
|
||||
stream.on('data', function(chunk){
|
||||
body += chunk;
|
||||
});
|
||||
stream.on('end', function(){
|
||||
callback(body);
|
||||
var fs = require('fs');
|
||||
fs.readFile(url, function (err, data) {
|
||||
if (err) {
|
||||
fabric.log(err);
|
||||
throw err;
|
||||
} else {
|
||||
callback(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue