nodeVersion function

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

Runs the current node version

Throws CommandNotFoundException if node is not found

since 0.0.1

Implementation

Future<String?> nodeVersion(IShell shell) async {
  shell.requireCommand('node');
  var version = cast<String>((await shell.run('node --version')).stdout);
  return version?.trim().replaceAll(RegExp(r'^v'), '');
}