Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Feb 29, 2024 via pnpm

minimatch 3.1.2

a glob matcher in javascript
Package summary
Share
0
issues
2
licenses
3
MIT
1
ISC
Package created
16 Jul 2011
Version published
15 Feb 2022
Maintainers
1
Total deps
4
Direct deps
1
License
ISC

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
balanced-match@1.0.2
brace-expansion@1.1.11
concat-map@0.0.1

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
minimatch@3.1.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of minimatch 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
brace-expansion1.1.114.14 kBMIT
prod

Visualizations

Frequently Asked Questions

What does minimatch do?

Minimatch is a minimalist matching utility used by npm internally. It utilizes glob expressions, converting them into JavaScript RegExp objects, to perform matching operations. This makes it an essential tool for a variety of tasks involving pattern matching in JavaScript.

How do you use minimatch?

To use minimatch in your JavaScript project, you first need to import it. You can either require the module or import it - both ways are supported. After importing, you call the minimatch function with two parameters - the string you want to test and the pattern you want to match against. For example:

const { minimatch } = require('minimatch');

console.log(minimatch('bar.foo', '*.foo')); // Outputs: true
console.log(minimatch('bar.foo', '*.bar')); // Outputs: false
console.log(minimatch('bar.foo', '*.+(bar|foo)', { debug: true })); // Outputs: true

As seen in the code block above, minimatch supports brace expansion, extended glob matching, Globstar '**' matching, and POSIX character classes - offering a wide variety of pattern matching options.

Now let's look at different operation you can perform. You can create a minimatch object using the minimatch.Minimatch class. For example:

var Minimatch = require('minimatch').Minimatch
var mm = new Minimatch(pattern, options)

The package also provides several functions to interact with pattern such as the filter(), makeRe(), escape(), unescape() and match() methods among others which can be used depending on your specific needs. For instance:

var isJS = minimatch(file, '*.js', { matchBase: true });
var javascripts = fileList.filter(minimatch.filter('*.js', { matchBase: true }));
var javascripts = minimatch.match(fileList, '*.js', { matchBase: true });

Where are the minimatch docs?

The documentation for the minimatch npm package can be found in the README file in its GitHub repository. The repository's URL is git://github.com/isaacs/minimatch.git. The README contains detailed information about usage, features, options and everything you need to effectively utilize the minimatch utility in your JavaScript projects.