Skip to content

Commit 60238c9

Browse files
authored
Update README.md
1 parent bb91f2b commit 60238c9

File tree

1 file changed

+0
-67
lines changed

1 file changed

+0
-67
lines changed

SoundBlox/README.md

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1 @@
1-
# Instances
2-
A .NET Standard `Process` wrapper with an elegant API, for both asyncronous and syncronous use, providing both Events and support for Tasks with cancellation support
3-
4-
![.NET Core](https://github.com/rosenbjerg/Instances/workflows/CI/badge.svg)
5-
[![codecov.io](https://codecov.io/github/rosenbjerg/agentdeploy/coverage.svg?branch=main)](https://app.codecov.io/gh/rosenbjerg/Instances)
6-
[![GitHub](https://img.shields.io/github/license/rosenbjerg/Instances)](https://github.com/rosenbjerg/Instances/blob/master/LICENSE)
7-
[![Nuget](https://img.shields.io/nuget/v/instances)](https://www.nuget.org/packages/instances/)
8-
[![Nuget](https://img.shields.io/nuget/dt/instances)](https://www.nuget.org/packages/instances/)
9-
![Dependent repos (via libraries.io)](https://img.shields.io/librariesio/dependent-repos/nuget/instances)
101

11-
12-
# Usage
13-
There are three ways to use this library, requiring at least 1, 2, or 3 lines of code to use.
14-
15-
### Shortest form, supporting only few options
16-
```c#
17-
var result = await Instance.FinishAsync("dotnet", "build -c Release", cancellationToken);
18-
Console.WriteLine(result.ExitCode);
19-
// or
20-
var result = Instance.Finish("dotnet", "build -c Release");
21-
```
22-
23-
### Short form, supporting more options
24-
```c#
25-
using var instance = Instance.Start("dotnet", "build -c Release");
26-
var result = await instance.WaitForExitAsync(cancellationToken);
27-
// or
28-
using var instance = Instance.Start("dotnet", "build -c Release");
29-
var result = instance.WaitForExit();
30-
```
31-
32-
### Full form, supporting all options
33-
```c#
34-
var processArgument = new ProcessArguments("dotnet", "build -c Release");
35-
processArgument.Exited += (_, exitResult) => Console.WriteLine(exitResult.ExitCode);
36-
processArgument.OutputDataReceived += (_, data) => Console.WriteLine(data);
37-
processArgument.ErrorDataReceived += (_, data) => Console.WriteLine(data);
38-
39-
using var instance = processArgument.Start();
40-
41-
var result = await instance.WaitForExitAsync(cancellationToken);
42-
// or
43-
var result = instance.WaitForExit();
44-
```
45-
46-
47-
## Features
48-
```c#
49-
using var instance = Instance.Start("dotnet", "build -c Release");
50-
51-
// send input to process' standard input
52-
instance.SendInput("Hello World");
53-
54-
// stop the process
55-
instance.Kill();
56-
57-
// access process output
58-
foreach (var line in instance.OutputData)
59-
Console.WriteLine(line);
60-
// and error data easily while the process is running
61-
foreach (var line in instance.ErrorData)
62-
Console.WriteLine(line);
63-
64-
// or wait for the process to exit (with support for cancellation token)
65-
var result = await instance.WaitForExitAsync(cancellationToken);
66-
Console.WriteLine(result.ExitCode);
67-
Console.WriteLine(result.OutputData.Count);
68-
```

0 commit comments

Comments
 (0)