npmVersion function

Future<String?> npmVersion(
  1. IShell shell
)

Runs the current npm version

Throws CommandNotFoundException if npm is not found

since 0.0.1

Implementation

Future<String?> npmVersion(IShell shell) async {
  shell.requireCommand('npm');
  var version = cast<String>((await shell.run('npm --version')).stdout);
  return version?.trim();
}