Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce async import #5280

Merged
merged 2 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/API/Extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,10 @@ module.exports = function(CLI) {
var i = 0
var projects = []
var enquirer = require('enquirer')
const forEach = require('async/forEach')

fs.readdir(path.join(__dirname, '../templates/sample-apps'), (err, items) => {
require('async').forEach(items, (app, next) => {
forEach(items, (app, next) => {
var fp = path.join(__dirname, '../templates/sample-apps', app)
fs.readFile(path.join(fp, 'package.json'), (err, dt) => {
var meta = JSON.parse(dt)
Expand Down
4 changes: 2 additions & 2 deletions lib/API/pm2-plus/auth-strategies/WebAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const http = require('http')
const fs = require('fs')
const url = require('url')
const exec = require('child_process').exec
const async = require('async')
const tryEach = require('async/tryEach');

module.exports = class WebStrategy extends AuthStrategy {
// the client will try to call this but we handle this part ourselves
Expand Down Expand Up @@ -53,7 +53,7 @@ module.exports = class WebStrategy extends AuthStrategy {
refresh_token: refresh
})
}
async.tryEach([
tryEach([
// try to find the token via the environment
(next) => {
if (!process.env.PM2_IO_TOKEN) {
Expand Down