Questions tagged [minimatch]

The de-facto file matching library used internally by node/npm and many node-based projects.

minimatch

A minimal matching utility.

This is the matching library used internally by npm.

It works by converting glob expressions into JavaScript RegExp objects.

Supports these glob features:

  • Brace Expansion
  • Extended glob matching
  • "Globstar" ** matching
52 questions
31
votes
1 answer

Glob / minimatch: how to gulp.src() everything, then exclude folder but keep one file in it

I have a project like this: root |-incl1 |-incl2 |- ... |-excl1 |-excl2 |- .gitignore <-- keep this one |- (other files) <-- exclude them I need to write gulp.src() that will include all folders except excl1 and excl2 but keep…
Borek Bernard
  • 50,745
  • 59
  • 165
  • 240
16
votes
3 answers

Cypress ignoreTestFiles is not ignoring tests

I'm trying to use ignoreTestFiles in cypress so that incomplete tests will not get run in the test suite. The path to my tests is: C:\Users\userA\IdeaProjects\automated_tests\cypress\integration\ignoredTestFiles In cypress.json, I have the…
TestRaptor
  • 1,305
  • 8
  • 24
  • 42
12
votes
2 answers

TFS drop, exclude obj folder using minimatch pattern

I'm setting up TFS 2015 on-prem and I'm having an issue on my last build step, Publish Build Artifacts. For some reason, the build agent appears to be archiving old binaries and I'm left with a huge filepath:…
Rodders
  • 2,425
  • 2
  • 20
  • 34
11
votes
1 answer

What is the "RegExp DoS issue"?

I just installed nodejs in a server and a basic npm install shows a lot of messages like this: $ npm install npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated…
fedorqui
  • 275,237
  • 103
  • 548
  • 598
11
votes
2 answers

How to specify file order with Grunt?

I've just started using Grunt, and I'm trying to get the concat task to concat my files in a specific order. Here's what I've got: module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), …
mpen
  • 272,448
  • 266
  • 850
  • 1,236
5
votes
2 answers

How to write a single minimatch glob that matches all js files not in a directory

I have a situation where I need a single glob pattern (that uses minimatch) to match all JavaScript files which are not in a certain directory. Unfortunately, I'm using another tool that doesn't expose any options (like an ignore glob), so it has to…
kentcdodds
  • 27,113
  • 32
  • 108
  • 187
4
votes
2 answers

How to update specific sub-package version by using npm

I had checked global package minimatch for gulp $ npm list -g minimatch +-- gulp@3.9.1 | `-- vinyl-fs@0.3.14 | +-- glob-stream@3.1.18 | | +-- glob@4.5.3 | | | `-- minimatch@2.0.10 deduped | | `-- minimatch@2.0.10 | `--…
sorabh86
  • 457
  • 4
  • 17
3
votes
1 answer

Grunt Files Object Format: All regular files files immediately under top level directory

I can't figure out for the life of me how to get this work. The grunt configuration for a module I'm using (grunt-sloc) requires the Files Object Format. Using this, I want to be able to match all regular files (i.e., non-directories) immediately…
GreenRaccoon23
  • 3,603
  • 7
  • 32
  • 46
3
votes
1 answer

What is the glob pattern matching all files that don't start with an underscore ignoring those in directories that start with an underscore?

Given the directory structure: a/ b/ _private/ notes.txt c/ _3.txt 1.txt 2.txt d/ 4.txt 5.txt How can I write a glob pattern (compatible with npm module glob) which selects the following…
Lea Hayes
  • 62,536
  • 16
  • 62
  • 111
3
votes
1 answer

Grunt usemin task not updating nested relative paths correctly

I have a Yeoman project scaffolded with 'webapp-generator' which contains a static website with nested HTML files, resembling this structure: -root/ index.html -directory/ file1.html -directory2/ file2.html -js/ …
Jesús Otero
  • 197
  • 4
  • 17
3
votes
1 answer

Including/excluding globs for gulp.src

I'm trying to setup a glob array for my javascript concat build task in gulp. The directory structure looks as follows: ├── about │ └── about.js ├── assets ├── contact ├── core │ ├── navbar │ │ ├── navbar.js │ │ └── navbar.test.js │ …
null
  • 7,906
  • 3
  • 36
  • 37
2
votes
0 answers

Glob minimatch pattern to get React and Meteor imports in a single group

I'm trying to setup eslint-plugin-import package to order my imports as I want to. Here is an unordered example: @chakra-ui/react meteor/meteor meteor/react-meteor-data api/templates/collection react react-i18next ui/state/useCsvMappingObject The…
2
votes
1 answer

Glob pattern to ignore certain .dot.js files

I am looking for a glob pattern that excludes certain parts of the file name. For example, I want to get all *.js files but exclude all *.map.js files. /hello/world.js // match /hello/world.map.js // no match /hello/world.test.js // match I thought…
Nickofthyme
  • 3,032
  • 23
  • 40
2
votes
1 answer

VSTS Minimatch pattern to exclude .git folder

I'm using VSTS and the build task FTP Upload. When the files and folders are uploaded to my FTP server the .git folder is always copied to the server too. I tried to exclude the .git folder with file pattern like following: ** !(**/.git/**) I don't…
1
2 3 4