Acklann.GlobN 2.1.0-rc

.NET Standard 2.0
This is a prerelease version of Acklann.GlobN.
There is a newer version of this package available.
See the version list below for details.
Install-Package Acklann.GlobN -Version 2.1.0-rc
dotnet add package Acklann.GlobN --version 2.1.0-rc
<PackageReference Include="Acklann.GlobN" Version="2.1.0-rc" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Acklann.GlobN --version 2.1.0-rc
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Acklann.GlobN, 2.1.0-rc"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

GlobN

NuGet NuGet License

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
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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 Downloads Last updated
2.1.7 3,479 9/9/2018
2.1.7-rc 601 7/2/2018
2.1.5-rc 609 7/1/2018
2.1.2-rc 671 7/1/2018
2.1.1-rc 581 6/29/2018
2.1.0-rc 575 6/28/2018
1.2.1 926 4/15/2018
1.1.0 800 3/9/2018
1.0.7 792 1/26/2018
1.0.6 744 1/10/2018
1.0.4 818 1/10/2018
1.0.1 793 1/8/2018

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.