updated package-lock and index.js

This commit is contained in:
pavanteja-potnuru
2018-08-28 12:01:48 +05:30
parent 5e09e01c84
commit 03e0ae2d9b
5 changed files with 480 additions and 43 deletions

View File

@@ -6,7 +6,6 @@ var convert = require('./lib/convert.js'),
module.exports = {
convert: function(input, options, cb) {
try {
var data;
if (input.type === 'string') {
return convert(input.data, cb);
}
@@ -14,8 +13,12 @@ module.exports = {
return convert(input.data, cb);
}
else if (input.type === 'file') {
data = fs.readFileSync(input.data).toString();
return convert(data, cb);
return fs.read(input.data, function(err, data) {
if (err) {
return cb(err);
}
return convert(data, cb);
});
}
return cb(null, {
result: false,