Acklann.GlobN
2.1.0-rc
See the version list below for details.
dotnet add package Acklann.GlobN --version 2.1.0-rc
NuGet\Install-Package Acklann.GlobN -Version 2.1.0-rc
<PackageReference Include="Acklann.GlobN" Version="2.1.0-rc" />
paket add Acklann.GlobN --version 2.1.0-rc
#r "nuget: Acklann.GlobN, 2.1.0-rc"
// Install Acklann.GlobN as a Cake Addin #addin nuget:?package=Acklann.GlobN&version=2.1.0-rc&prerelease // Install Acklann.GlobN as a Cake Tool #tool nuget:?package=Acklann.GlobN&version=2.1.0-rc&prerelease
GlobN
What is GlobN
GlobN is a file pattern matching library for .NET. Grabbing files from the command-line can never be easier.
How it works
Let say your current directory is as follows.
C:\projects\coolapp
index.html
js/
-- site.ts
-- site.js
-- viewModel/
-- view.ts
-- view.js
Most of the functions you'll be utilizing are extension methods. So lets say you want to grab all the files within the current directory.
string cd = System.Environment.CurrentDirectory;
IEnumerable<string> all5Files = cd.GetFiles();
Lets say your in the css folder and you want to grab all of the .js
files.
var siteJs = cd.GetFiles("../js/*.js");
/* return: js\site.js */
var allJsFiles cd.GetFiles(@"..\**\*.js");
/* return: js\site.js; js\viewModel\view.js */
Finally, here are some other straight forward examples.
var filteredList = listOfPaths.Filter("*.js");
IEnumerable<string> files = @"..\js\*.ts".ResolvePath();
Glob glob = "*.png";
glob.IsMatch("/site/content/bg.png");
Supported Expressions
Pattern | Description |
---|---|
..\ | Moves the current directory up one folder. Only applicable at the beginning of the pattern. |
* | Match zero or more characters excluding the directory separator. |
** | Match zero or more directories. |
? | Match a single character. |
! | Negates the matching pattern. Only applicable at the beginning of the pattern. |
NOTE: matches a case-insensitive.
Where can I get it
GlobN is available at nuget.org. PM> Install-Package Acklann.GlobN
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Memory (>= 4.5.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Acklann.GlobN:
Package | Downloads |
---|---|
Daterpillar
A library for generating SQL migration scripts. |
GitHub repositories
This package is not used by any popular GitHub repositories.
version 1.0.7
-------------
Enhancements:
* Make matches case-insensitive.
version 1.0.0
-------------
Features:
* Suuports the following wildcards ('*', '**', '?').
* Supports the path expansion for both environment variables and parent directories ('..\').
* Supports pattern negating matches ('!').
* Supports filtering list of paths.