Hierarchy

Properties

absolute?: boolean
allowEmpty?: boolean

Prevents stream from emitting an error when file not found.

base?: string

Specifies the folder relative to the cwd This is used to determine the file names when saving in .dest() Default: where the glob begins

buffer?: boolean

Setting this to false will make file.contents a paused stream If true it will buffer the file contents Default: true

cache?: {
    [path: string]: boolean | "DIR" | "FILE" | ReadonlyArray<string>;
}

Type declaration

  • [path: string]: boolean | "DIR" | "FILE" | ReadonlyArray<string>
cwd?: string

Specifies the working directory the folder is relative to

cwdbase?: boolean

Whether or not the cwd and base should be the same.

debug?: boolean

Dump a ton of stuff to stderr.

Default

false

dirMode?: number

The mode the directory should be created with. Default: the process mode

dot?: boolean

Whether or not you want globs to match on dot files or not (e.g., .gitignore).

flipNegate?: boolean

Returns from negate expressions the same as if they were not negated. (Ie, true on a hit, false on a miss.)

Default

false

follow?: boolean
followSymlinks?: boolean

Whether or not to recursively resolve symlinks to their targets. Setting to false to preserve them as symlinks and make file.symlink equal the original symlink's target path. Default: true

fs?: "fs"
ignore?: string | readonly string[]
mark?: boolean
matchBase?: any

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.

Default

false

nobrace?: boolean

Do not expand {a,b} and {1..3} brace sets.

Default

false

nocase?: boolean

Perform a case-insensitive match.

Default

false

nocomment?: boolean

Suppress the behavior of treating # at the start of a pattern as a comment.

Default

false

nodir?: boolean
noext?: boolean

Disable "extglob" style patterns like +(a|b).

Default

false

noglobstar?: boolean

Disable ** matching against multiple folder names.

Default

false

nomount?: boolean
nonegate?: boolean

Suppress the behavior of treating a leading ! character as negation.

Default

false

nonull?: boolean

When a match is not found by minimatch.match, return a list containing the pattern itself if this option is set. Otherwise, an empty list is returned if there are no matches.

Default

false

nosort?: boolean
nounique?: boolean
partial?: boolean

Compare a partial path to a pattern. As long as the parts of the path that are present are not contradicted by the pattern, it will be treated as a match. This is useful in applications where you're walking through a folder structure, and don't yet have the full path, but want to ensure that you do not walk down paths that can never be a match.

Default

false

Example

import minimatch = require("minimatch");

minimatch('/a/b', '/a/*' + '/c/d', { partial: true }) // true, might be /a/b/c/d
minimatch('/a/b', '/**' + '/d', { partial: true }) // true, might be /a/b/.../d
minimatch('/x/y/z', '/a/**' + '/z', { partial: true }) // false, because x !== a
passthrough?: boolean

Setting this to true will create a duplex stream, one that passes through items and emits globbed files. Default: false

read?: boolean

Setting this to false will ignore the contents of the file and disable writing to disk to speed up operations Default: true

realpath?: boolean
realpathCache?: {
    [path: string]: string;
}

Type declaration

  • [path: string]: string
relative?: boolean

Whether or not the symlink should be relative or absolute. Default: false

removeBOM?: boolean

Causes the BOM to be removed on UTF-8 encoded files. Set to false if you need the BOM for some reason. Default: true

resolveSymlinks?: boolean

Whether or not to recursively resolve symlinks to their targets. Setting to false to preserve them as symlinks and make file.symlink equal the original symlink's target path. Default: false

root?: string
silent?: boolean
since?: number | Date

Only find files that have been modified since the time specified

sourcemaps?: boolean

Setting this to true will enable sourcemaps. Default: false

stat?: boolean
statCache?: {
    [path: string]: false | {
        isDirectory(): boolean;
    } | undefined;
}

Type declaration

  • [path: string]: false | {
        isDirectory(): boolean;
    } | undefined
strict?: boolean
stripBOM?: boolean

Causes the BOM to be stripped on UTF-8 encoded files. Set to false if you need the BOM for some reason.

symlinks?: {
    [path: string]: boolean | undefined;
}

Type declaration

  • [path: string]: boolean | undefined
sync?: boolean

Filters stream to remove duplicates based on the string property name or the result of function. When using a function, the function receives the streamed data (objects containing cwd, base, path properties) to compare against.

windowsPathsNoEscape?: boolean

Use \\ as a path separator only, and never as an escape character. If set, all \\ characters are replaced with / in the pattern. Note that this makes it impossible to match against paths containing literal glob pattern characters, but allows matching with patterns constructed using path.join() and path.resolve() on Windows platforms, mimicking the (buggy!) behavior of earlier versions on Windows. Please use with caution, and be mindful of the caveat about Windows paths

For legacy reasons, this is also set if options.allowWindowsEscape is set to the exact value false.

Default

false