Skip to content

Commit d8fb5ec

Browse files
rektideDaniel15
authored andcommitted
Allow transform to be a promise. Resolves #210.
1 parent 5910a4d commit d8fb5ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function run(data) {
145145
async.each(
146146
files,
147147
function(file, callback) {
148-
fs.readFile(file, function(err, source) {
148+
fs.readFile(file, async function(err, source) {
149149
if (err) {
150150
updateStatus('error', file, 'File error: ' + err);
151151
callback();
@@ -154,7 +154,7 @@ function run(data) {
154154
source = source.toString();
155155
try {
156156
const jscodeshift = prepareJscodeshift(options);
157-
const out = transform(
157+
const out = await transform(
158158
{
159159
path: file,
160160
source: source,

0 commit comments

Comments
 (0)