Minor refactoring

This commit is contained in:
Shaun Tabone 2019-12-29 14:55:04 +01:00
parent 2e003b0dc5
commit e0d73c9b8e

View file

@ -54,8 +54,8 @@ function checkNPM(cancellationToken?: CancellationToken): Promise<void> {
function getNpmDependencies(cwd: string): Promise<string[]> {
return checkNPM()
.then(({ stdout }) => stdout
.then(() => exec('npm list --production --parseable --depth=99999 --loglevel=error', { cwd, maxBuffer: 5000 * 1024 }))
.then(({ stdout }) => stdout
.split(/[\r\n]/)
.filter(dir => path.isAbsolute(dir)));
}