Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doks-coders/codeformatterpackage
Nuget Package built for formatting cs files
https://github.com/doks-coders/codeformatterpackage
csfiles csharp formatter nuget nuget-package
Last synced: 7 days ago
JSON representation
Nuget Package built for formatting cs files
- Host: GitHub
- URL: https://github.com/doks-coders/codeformatterpackage
- Owner: doks-coders
- Created: 2024-03-11T02:33:45.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-19T00:15:48.000Z (9 months ago)
- Last Synced: 2024-10-31T03:21:08.602Z (about 2 months ago)
- Topics: csfiles, csharp, formatter, nuget, nuget-package
- Language: C#
- Homepage: https://youtu.be/9TvZ87yO0Cg
- Size: 33.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Codeformatter Package
A Simple Text formatter that formats the contents of a file using the c# style.
[Watch Video](https://youtu.be/9TvZ87yO0Cg)## Installation
```csharp
Install-Package CodeFormatterModule
```## Imports
#### import the Codeformatter
```csharp
using CodeFormatterModule;
```
## API Reference### Format a single file
Pass in the path of the file you want formatted
```csharp
var formatter = new FormatCode();try
{
formatter.FormatCodeFile("File.cs");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
```| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `path` | `string` | Should contain relative path to your file |### Format multiple files
Pass in the paths of the file you want formatted in a string array
```csharp
var formatter = new FormatCode();try
{
var files = new string[] { "File1.cs", "File2.cs" };
formatter.FormatCodeFile(files);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
```| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `paths` | `string []` | Should contain relative paths to your files |### Format all files in directory and subdirectory
Pass in the path of the folder you want formatted
```csharp
var formatter = new FormatCode();try
{
formatter.FormatCodeFile("Folder",children:true);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
```| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `fileDirectory` | `string` | Should contain relative path to your folder |
| `children` | `boolean` | Should be used if you want the children of the folder |