Skip to content

Commit

Permalink
Allow transform to be a promise. Resolves #210.
Browse files Browse the repository at this point in the history
  • Loading branch information
rektide authored and Daniel15 committed Mar 31, 2021
1 parent 5910a4d commit d8fb5ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function run(data) {
async.each(
files,
function(file, callback) {
fs.readFile(file, function(err, source) {
fs.readFile(file, async function(err, source) {
if (err) {
updateStatus('error', file, 'File error: ' + err);
callback();
Expand All @@ -154,7 +154,7 @@ function run(data) {
source = source.toString();
try {
const jscodeshift = prepareJscodeshift(options);
const out = transform(
const out = await transform(
{
path: file,
source: source,
Expand Down

0 comments on commit d8fb5ec

Please sign in to comment.