Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Remove async-foreach dependency
Browse files Browse the repository at this point in the history
Fixes #2487
  • Loading branch information
xzyfer committed Nov 7, 2019
1 parent 6fdfdc6 commit 910527c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
26 changes: 12 additions & 14 deletions bin/node-sass
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

var Emitter = require('events').EventEmitter,
forEach = require('async-foreach').forEach,
promisify = require('util').promisify,
chokidar = require('chokidar'),
meow = require('meow'),
util = require('util'),
Expand Down Expand Up @@ -410,19 +410,17 @@ function renderDir(options, emitter, done) {
return emitter.emit('error', 'No input file was found.');
}

forEach(files, function(subject) {
renderFile(subject, options, emitter, this.async());
}, function(successful, arr) {
var outputDir = path.join(process.cwd(), options.output);
if (!options.quiet) {
emitter.emit('info', util.format('Wrote %s CSS files to %s', arr.length, outputDir));
}
if (successful) {
done();
} else {
done(new Error('Some files failed to compile'));
}
});
Promise.all(files.map(subject => {
return promisify(renderFile)(subject, options, emitter);
}))
.then(res => {
var outputDir = path.join(process.cwd(), options.output);
if (!options.quiet) {
emitter.emit('info', util.format('Wrote %s CSS files to %s', res.length, outputDir));
}
})
.catch(() => done(new Error('Some files failed to compile')))
.then(done)
});
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"style"
],
"dependencies": {
"async-foreach": "^0.1.3",
"chalk": "^2.4.2",
"chokidar": "^3.3.0",
"cross-spawn": "^7.0.1",
Expand Down

0 comments on commit 910527c

Please sign in to comment.