GitHub
Tests: 12 • Commercial: 2 • Pet projects: 4 • Legacy: 4
Total: 22

.NET Framework

Test
2021

Project Request

ASP.NET MVC • C# • SQL Server
Idea of the project: if someone wants to order a project development, here you can send an application.
Test
2020

ProjectC

ASP.NET MVC • C# • JSON • jQuery
JSON data processing.
Test
2020

Vehicle Maintenance

ASP.NET MVC • VB.NET • JSON
Idea of the project: if someone wants to order a project development, here you can send an application.
Test
2019

Movie Navigator

ASP.NET MVC • VB.NET
Request information about movie from IMDB.
Test
2018

Customers Exchange

ASP.NET MVC • C# • SQL Server
Automated teller machine emulation.
Test
2016

ATM

ASP.NET MVC • C#
Automated teller machine emulation.

.NET Core

Pet project
2022

Mail Daemon

.NET 8 • Console • JSON
Utility to send mails with customizable settings.

Custom

Code
2024

Buns of code

.NET Framework • C# • JavaScript
Code snippets from my projects, ready to use; tiny tests; code examples.

PHP

Test
2024

Mediabox

PHP 8 • Laravel 11 • Vue.js • Composer • SQLite
Test project for media files management.
Test
2020

Loan Castle

PHP • MariaDB
Jums jāizstrādā kāda lielāk projekta prototips. Izstrādājot prototipu, paturiet prātā, ka projektam attīstoties, šo prototipu varētu vajadzēt pilnveidot.
Test
2020

Content Management

PHP • MySQL • AJAX
Создать простой сайт, где будет страница с формой для авторизации и страница для авторизованного пользователя.
Test
2019

Laravel

PHP • Laravel • Vue.js • Composer • SQLite
Izveidot aplikāciju, kura ik pēc noteikta intervāla (60 sekundes) veic ierakstu datubāzē izmantojot Laravel freimworka iebūvēto funkcionalitāti.
Test
2019

Phone Check

PHP • JavaScript • JSON • Docker
Implement application to detect country by phone number.

Frontend

Test
2021

Forex Wall

npm • React
For this exercise, what we need is a simple live wall for tracking currencies.

Business projects

Commercial
2008

Certification Center

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • SQL Server • ADO.NET • Dapper • JavaScript • jQuery • Git
Transport registration and certification services in Latvia, Customer Relationship Management.
Commercial
2000

Amerikas Auto

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • SQL Server • ADO.NET • Entity Framework • JavaScript • jQuery • Git
Car service and spare parts for all USA and European car models, Customer Relationship Management.

Pet projects

Pet project
2023

Geolocation Assistant

.NET 8 • ASP.NET Core • C# • Web API • JSON • Git
Website for determining geolocation by IP or geotagged photo.
Pet project
2008

Web Dynamics

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • Web API • JSON • SQL Server • Dapper • JavaScript • jQuery • SVG • Git
Software development blog. Articles, books, videos, content management.
Pet project
2000

Blackball

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • Web API • JSON • XML • SQL Server • Dapper • JavaScript • jQuery • SVG • Git
My entertainment portal created from scratch.

Good old times

Legacy
2000

DOS Clock

Turbo Pascal • Assembler
Digital clock.
Legacy
2000

BrainOut

Turbo Pascal • Assembler
Tank battle game.
Legacy
1999

Airport Administrator

Turbo Pascal
Курсовая работа в институте.
Legacy
1998

Atomizer

Turbo Pascal • Assembler
Atomizer, aka «Studio2D». Graphic raster editor. AGI is my own «Atomizer Generated Image» file format.

Mediabox

2024 Test

Test project for media files management.

PHP 8 Laravel 11 Vue.js Composer SQLite
Information
Source code
  app
  Http
  .bin
  vite
  lib
  dist
  esm
  node
  lib
  core
  env
  node
  lib
  lib
  lib
  lib
  dist
  lib
  lib
  dist
  es
  lib
  vite
  dist
  node
  dist
  css
  js
  app
  data
  logs
  Unit
  math
  src
  src
  src
  docs
  en
  lib
  src
  src
  Cron
  src
  src
  Core
  ORM
  Spot
  filp
  src
  css
  js
  Util
  src
  src
  src
  src
  psr7
  src
  src
  Core
  Text
  Type
  Xml
  Core
  Text
  Type
  Xml
  src
  Auth
  make
  Bus
  View
  Auth
  Bus
  Http
  Mail
  View
  Auth
  Bus
  Http
  dist
  Http
  Json
  Log
  Mail
  html
  text
  Jobs
  lang
  en
  View
  pint
  pint
  src
  sail
  8.0
  8.1
  8.2
  8.3
  src
  src
  src
  src
  Node
  Util
  Node
  Node
  Node
  Data
  Node
  Node
  Util
  Xml
  src
  src
  src
  docs
  Pass
  src
  Curl
  Test
  src
  Date
  Spl
  lazy
  src
  Cli
  Lang
  List
  src
  src
  lib
  Node
  Expr
  Cast
  Name
  Stmt
  src
  src
  Html
  src
  xml
  src
  src
  src
  Data
  Node
  Html
  css
  js
  Xml
  Util
  src
  src
  src
  src
  src
  Test
  Test
  Math
  Type
  Api
  Rule
  Stub
  Api
  PHPT
  Cli
  Xml
  Util
  PHP
  Xml
  psr
  src
  src
  src
  src
  src
  docs
  src
  log
  src
  src
  psy
  src
  Hoa
  77
  78
  Sudo
  Util
  src
  src
  Map
  Tool
  uuid
  src
  Time
  Guid
  Lazy
  Math
  Dce
  Node
  Time
  Type
  src
  src
  src
  src
  src
  diff
  src
  src
  src
  src
  src
  src
  src
  src
  type
  src
  type
  src
  Test
  CI
  Node
  css
  js
  File
  Test
  Log
  Test
  Smtp
  Auth
  mime
  Part
  Test
  Test
  data
  data
  Test
  Util
  Test
  uid
  css
  js
  Test
  yaml
  Tag
  src
  src
  Css
  Rule
  src
  File
  Util
  voku
  src
  voku
  data
  src
  .env
Root / node_modules / picomatch
Name
Size
Date created
Date modified
lib
25.08.2024 16:04
25.08.2024 16:04
6 KB
25.08.2024 16:04
25.08.2024 12:31
60 bytes
25.08.2024 16:04
25.08.2024 12:31
1 KB
25.08.2024 16:04
25.08.2024 12:31
2 KB
25.08.2024 16:04
25.08.2024 12:31
27 KB
25.08.2024 16:04
25.08.2024 12:31
README.MD

Picomatch

version test status coverage status downloads



Blazing fast and accurate glob matcher written in JavaScript.
No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.



Why picomatch?

  • Lightweight - No dependencies
  • Minimal - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function.
  • Fast - Loads in about 2ms (that's several times faster than a single frame of a HD movie at 60fps)
  • Performant - Use the returned matcher function to speed up repeat matching (like when watching files)
  • Accurate matching - Using wildcards (* and ?), globstars (**) for nested directories, advanced globbing with extglobs, braces, and POSIX brackets, and support for escaping special characters with \ or quotes.
  • Well tested - Thousands of unit tests

See the library comparison to other libraries.



Table of Contents

Click to expand

(TOC generated by verb using markdown-toc)



Install

Install with npm:

npm install --save picomatch

Usage

The main export is a function that takes a glob pattern and an options object and returns a function for matching strings.

const pm = require('picomatch');
const isMatch = pm('*.js');

console.log(isMatch('abcd')); //=> false
console.log(isMatch('a.js')); //=> true
console.log(isMatch('a.md')); //=> false
console.log(isMatch('a/b.js')); //=> false

API

picomatch

Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information.

Params

  • globs {String|Array}: One or more glob patterns.
  • options {Object=}
  • returns {Function=}: Returns a matcher function.

Example

const picomatch = require('picomatch');
// picomatch(glob[, options]);

const isMatch = picomatch('*.!(*a)');
console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true

.test

Test input with the given regex. This is used by the main picomatch() function to test the input string.

Params

  • input {String}: String to test.
  • regex {RegExp}
  • returns {Object}: Returns an object with matching info.

Example

const picomatch = require('picomatch');
// picomatch.test(input, regex[, options]);

console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }

.matchBase

Match the basename of a filepath.

Params

  • input {String}: String to test.
  • glob {RegExp|String}: Glob pattern or regex created by .makeRe.
  • returns {Boolean}

Example

const picomatch = require('picomatch');
// picomatch.matchBase(input, glob[, options]);
console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true

.isMatch

Returns true if any of the given glob patterns match the specified string.

Params

  • {String|Array}: str The string to test.
  • {String|Array}: patterns One or more glob patterns to use for matching.
  • {Object}: See available options.
  • returns {Boolean}: Returns true if any patterns match str

Example

const picomatch = require('picomatch');
// picomatch.isMatch(string, patterns[, options]);

console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
console.log(picomatch.isMatch('a.a', 'b.*')); //=> false

.parse

Parse a glob pattern to create the source string for a regular expression.

Params

  • pattern {String}
  • options {Object}
  • returns {Object}: Returns an object with useful properties and output to be used as a regex source string.

Example

const picomatch = require('picomatch');
const result = picomatch.parse(pattern[, options]);

.scan

Scan a glob pattern to separate the pattern into segments.

Params

  • input {String}: Glob pattern to scan.
  • options {Object}
  • returns {Object}: Returns an object with

Example

const picomatch = require('picomatch');
// picomatch.scan(input[, options]);

const result = picomatch.scan('!./foo/*.js');
console.log(result);
{ prefix: '!./',
  input: '!./foo/*.js',
  start: 3,
  base: 'foo',
  glob: '*.js',
  isBrace: false,
  isBracket: false,
  isGlob: true,
  isExtglob: false,
  isGlobstar: false,
  negated: true }

.compileRe

Compile a regular expression from the state object returned by the parse() method.

Params

  • state {Object}
  • options {Object}
  • returnOutput {Boolean}: Intended for implementors, this argument allows you to return the raw output from the parser.
  • returnState {Boolean}: Adds the state to a state property on the returned regex. Useful for implementors and debugging.
  • returns {RegExp}

.makeRe

Create a regular expression from a parsed glob pattern.

Params

  • state {String}: The object returned from the .parse method.
  • options {Object}
  • returnOutput {Boolean}: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
  • returnState {Boolean}: Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
  • returns {RegExp}: Returns a regex created from the given pattern.

Example

const picomatch = require('picomatch');
const state = picomatch.parse('*.js');
// picomatch.compileRe(state[, options]);

console.log(picomatch.compileRe(state));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/

.toRegex

Create a regular expression from the given regex source string.

Params

  • source {String}: Regular expression source string.
  • options {Object}
  • returns {RegExp}

Example

const picomatch = require('picomatch');
// picomatch.toRegex(source[, options]);

const { output } = picomatch.parse('*.js');
console.log(picomatch.toRegex(output));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/

Options

Picomatch options

The following options may be used with the main picomatch() function or any of the methods on the picomatch API.

| Option | Type | Default value | Description | | --- | --- | --- | --- | | basename | boolean | false | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, a?b would match the path /xyz/123/acb, but not /xyz/acb/123. | | bash | boolean | false | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (**). | | capture | boolean | undefined | Return regex matches in supporting methods. | | contains | boolean | undefined | Allows glob to match any part of the given string(s). | | cwd | string | process.cwd() | Current working directory. Used by picomatch.split() | | debug | boolean | undefined | Debug regular expressions when an error is thrown. | | dot | boolean | false | Enable dotfile matching. By default, dotfiles are ignored unless a . is explicitly defined in the pattern, or options.dot is true | | expandRange | function | undefined | Custom function for expanding ranges in brace patterns, such as {a..z}. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. | | failglob | boolean | false | Throws an error if no matches are found. Based on the bash option of the same name. | | fastpaths | boolean | true | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to false. | | flags | string | undefined | Regex flags to use in the generated regex. If defined, the nocase option will be overridden. | | format | function | undefined | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | | ignore | array\|string | undefined | One or more glob patterns for excluding strings that should not be matched from the result. | | keepQuotes | boolean | false | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | | literalBrackets | boolean | undefined | When true, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | | matchBase | boolean | false | Alias for basename | | maxLength | boolean | 65536 | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | | nobrace | boolean | false | Disable brace matching, so that {a,b} and {1..3} would be treated as literal characters. | | nobracket | boolean | undefined | Disable matching with regex brackets. | | nocase | boolean | false | Make matching case-insensitive. Equivalent to the regex i flag. Note that this option is overridden by the flags option. | | nodupes | boolean | true | Deprecated, use nounique instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | | noext | boolean | false | Alias for noextglob | | noextglob | boolean | false | Disable support for matching with extglobs (like +(a\|b)) | | noglobstar | boolean | false | Disable support for matching nested directories with globstars (**) | | nonegate | boolean | false | Disable support for negating with leading ! | | noquantifiers | boolean | false | Disable support for regex quantifiers (like a{1,2}) and treat them as brace patterns to be expanded. | | onIgnore | function | undefined | Function to be called on ignored items. | | onMatch | function | undefined | Function to be called on matched items. | | onResult | function | undefined | Function to be called on all items, regardless of whether or not they are matched or ignored. | | posix | boolean | false | Support POSIX character classes ("posix brackets"). | | posixSlashes | boolean | undefined | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | | prepend | boolean | undefined | String to prepend to the generated regex used for matching. | | regex | boolean | false | Use regular expression rules for + (instead of matching literal +), and for stars that follow closing parentheses or brackets (as in )* and ]*). | | strictBrackets | boolean | undefined | Throw an error if brackets, braces, or parens are imbalanced. | | strictSlashes | boolean | undefined | When true, picomatch won't match trailing slashes with single stars. | | unescape | boolean | undefined | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. | | unixify | boolean | undefined | Alias for posixSlashes, for backwards compatibility. |

picomatch has automatic detection for regex positive and negative lookbehinds. If the pattern contains a negative lookbehind, you must be using Node.js >= 8.10 or else picomatch will throw an error.

Scan Options

In addition to the main picomatch options, the following options may also be used with the .scan method.

| Option | Type | Default value | Description | | --- | --- | --- | --- | | tokens | boolean | false | When true, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern | | parts | boolean | false | When true, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when options.tokens is true |

Example

const picomatch = require('picomatch');
const result = picomatch.scan('!./foo/*.js', { tokens: true });
console.log(result);
// {
//   prefix: '!./',
//   input: '!./foo/*.js',
//   start: 3,
//   base: 'foo',
//   glob: '*.js',
//   isBrace: false,
//   isBracket: false,
//   isGlob: true,
//   isExtglob: false,
//   isGlobstar: false,
//   negated: true,
//   maxDepth: 2,
//   tokens: [
//     { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true },
//     { value: 'foo', depth: 1, isGlob: false },
//     { value: '*.js', depth: 1, isGlob: true }
//   ],
//   slashes: [ 2, 6 ],
//   parts: [ 'foo', '*.js' ]
// }

Options Examples

options.expandRange

Type: function

Default: undefined

Custom function for expanding ranges in brace patterns. The fill-range library is ideal for this purpose, or you can use custom code to do whatever you need.

Example

The following example shows how to create a glob that matches a folder

const fill = require('fill-range');
const regex = pm.makeRe('foo/{01..25}/bar', {
  expandRange(a, b) {
    return `(${fill(a, b, { toRegex: true })})`;
  }
});

console.log(regex);
//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/

console.log(regex.test('foo/00/bar'))  // false
console.log(regex.test('foo/01/bar'))  // true
console.log(regex.test('foo/10/bar')) // true
console.log(regex.test('foo/22/bar')) // true
console.log(regex.test('foo/25/bar')) // true
console.log(regex.test('foo/26/bar')) // false

options.format

Type: function

Default: undefined

Custom function for formatting strings before they're matched.

Example

// strip leading './' from strings
const format = str => str.replace(/^\.\//, '');
const isMatch = picomatch('foo/*.js', { format });
console.log(isMatch('./foo/bar.js')); //=> true

options.onMatch

const onMatch = ({ glob, regex, input, output }) => {
  console.log({ glob, regex, input, output });
};

const isMatch = picomatch('*', { onMatch });
isMatch('foo');
isMatch('bar');
isMatch('baz');

options.onIgnore

const onIgnore = ({ glob, regex, input, output }) => {
  console.log({ glob, regex, input, output });
};

const isMatch = picomatch('*', { onIgnore, ignore: 'f*' });
isMatch('foo');
isMatch('bar');
isMatch('baz');

options.onResult

const onResult = ({ glob, regex, input, output }) => {
  console.log({ glob, regex, input, output });
};

const isMatch = picomatch('*', { onResult, ignore: 'f*' });
isMatch('foo');
isMatch('bar');
isMatch('baz');


Globbing features

Basic globbing

| Character | Description | | --- | --- | | * | Matches any character zero or more times, excluding path separators. Does not match path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the dot option to true. | | ** | Matches any character zero or more times, including path separators. Note that ** will only match path separators (/, and \\ on Windows) when they are the only characters in a path segment. Thus, foo**/bar is equivalent to foo*/bar, and foo/a**b/bar is equivalent to foo/a*b/bar, and more than two consecutive stars in a glob path segment are regarded as a single star. Thus, foo/***/bar is equivalent to foo/*/bar. | | ? | Matches any character excluding path separators one time. Does not match path separators or leading dots. | | [abc] | Matches any characters inside the brackets. For example, [abc] would match the characters a, b or c, and nothing else. |

Matching behavior vs. Bash

Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions:

  • Bash will match foo/bar/baz with *. Picomatch only matches nested directories with **.
  • Bash greedily matches with negated extglobs. For example, Bash 4.3 says that !(foo)* should match foo and foobar, since the trailing * bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return false for both foo and foobar.

Advanced globbing

Extglobs

| Pattern | Description | | --- | --- | | @(pattern) | Match only one consecutive occurrence of pattern | | *(pattern) | Match zero or more consecutive occurrences of pattern | | +(pattern) | Match one or more consecutive occurrences of pattern | | ?(pattern) | Match zero or one consecutive occurrences of pattern | | !(pattern) | Match anything but pattern |

Examples

const pm = require('picomatch');

// *(pattern) matches ZERO or more of "pattern"
console.log(pm.isMatch('a', 'a*(z)')); // true
console.log(pm.isMatch('az', 'a*(z)')); // true
console.log(pm.isMatch('azzz', 'a*(z)')); // true

// +(pattern) matches ONE or more of "pattern"
console.log(pm.isMatch('a', 'a*(z)')); // true
console.log(pm.isMatch('az', 'a*(z)')); // true
console.log(pm.isMatch('azzz', 'a*(z)')); // true

// supports multiple extglobs
console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false

// supports nested extglobs
console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true

POSIX brackets

POSIX classes are disabled by default. Enable this feature by setting the posix option to true.

Enable POSIX bracket support

console.log(pm.makeRe('[[:word:]]+', { posix: true }));
//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/

Supported POSIX classes

The following named POSIX bracket expressions are supported:

  • [:alnum:] - Alphanumeric characters, equ [a-zA-Z0-9]
  • [:alpha:] - Alphabetical characters, equivalent to [a-zA-Z].
  • [:ascii:] - ASCII characters, equivalent to [\\x00-\\x7F].
  • [:blank:] - Space and tab characters, equivalent to [ \\t].
  • [:cntrl:] - Control characters, equivalent to [\\x00-\\x1F\\x7F].
  • [:digit:] - Numerical digits, equivalent to [0-9].
  • [:graph:] - Graph characters, equivalent to [\\x21-\\x7E].
  • [:lower:] - Lowercase letters, equivalent to [a-z].
  • [:print:] - Print characters, equivalent to [\\x20-\\x7E ].
  • [:punct:] - Punctuation and symbols, equivalent to [\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_{|}~]`.
  • [:space:] - Extended space characters, equivalent to [ \\t\\r\\n\\v\\f].
  • [:upper:] - Uppercase letters, equivalent to [A-Z].
  • [:word:] - Word characters (letters, numbers and underscores), equivalent to [A-Za-z0-9_].
  • [:xdigit:] - Hexadecimal digits, equivalent to [A-Fa-f0-9].

See the Bash Reference Manual for more information.

Braces

Picomatch does not do brace expansion. For brace expansion and advanced matching with braces, use micromatch instead. Picomatch has very basic support for braces.

Matching special characters as literals

If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes:

Special Characters

Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms.

To match any of the following characters as literals: `$^*+?()[]

Examples:

console.log(pm.makeRe('foo/bar \\(1\\)'));
console.log(pm.makeRe('foo/bar \\(1\\)'));


Library Comparisons

The following table shows which features are supported by minimatch, micromatch, picomatch, nanomatch, extglob, braces, and expand-brackets.

| Feature | minimatch | micromatch | picomatch | nanomatch | extglob | braces | expand-brackets | | --- | --- | --- | --- | --- | --- | --- | --- | | Wildcard matching (*?+) | ✔ | ✔ | ✔ | ✔ | - | - | - | | Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - | | Brace matching | ✔ | ✔ | ✔ | - | - | ✔ | - | | Brace expansion | ✔ | ✔ | - | - | - | ✔ | - | | Extglobs | partial | ✔ | ✔ | - | ✔ | - | - | | Posix brackets | - | ✔ | ✔ | - | - | - | ✔ | | Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ | | File system operations | - | - | - | - | - | - | - |



Benchmarks

Performance comparison of picomatch and minimatch.

# .makeRe star
  picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled)
  minimatch x 627,206 ops/sec ±1.96% (87 runs sampled))

# .makeRe star; dot=true
  picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled)
  minimatch x 525,876 ops/sec ±0.60% (88 runs sampled)

# .makeRe globstar
  picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled)
  minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d)

# .makeRe globstars
  picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled)
  minimatch x 477,179 ops/sec ±1.33% (91 runs sampled)

# .makeRe with leading star
  picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled)
  minimatch x 453,564 ops/sec ±1.43% (94 runs sampled)

# .makeRe - basic braces
  picomatch x 392,067 ops/sec ±0.70% (90 runs sampled)
  minimatch x 99,532 ops/sec ±2.03% (87 runs sampled))


Philosophies

The goal of this library is to be blazing fast, without compromising on accuracy.

Accuracy

The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: !(**/{a,b,*/c}).

Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements.

Performance

Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer.



About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

npm install && npm test
Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

npm install -g verbose/verb#dev verb-generate-readme && verb

Author

Jon Schlinkert

License

Copyright © 2017-present, Jon Schlinkert. Released under the MIT License.