public static string NpmView(this ICakeContext context, string packageName = null, string workingDirectory = null) { NpmViewSettings settings = new NpmViewSettings() { LogLevel = NpmLogLevel.Info, PackageName = packageName, WorkingDirectory = workingDirectory }; return(new NpmViewTools(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log).View(settings)); }
public string View(NpmViewSettings settings) { IEnumerable <string> output = new List <string>(); try { RunCore(settings, new ProcessSettings(), process => { output = process.GetStandardOutput(); }); return(string.Join("\n", output)); } catch (CakeException ex) { CakeLog.Information("Error while calling npm view: " + ex.Message); return(""); } }