Socket
Socket
Sign inDemoInstall

glob

Package Overview
Dependencies
20
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 10.1.0 to 10.2.0

dist/cjs/src/bin.d.ts

99

dist/cjs/package.json
{
"type": "commonjs"
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "glob",
"description": "the most correct and second fastest glob implementation in JavaScript",
"version": "10.2.0",
"bin": "./dist/cjs/src/bin.js",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-glob.git"
},
"main": "./dist/cjs/src/index.js",
"module": "./dist/mjs/index.js",
"types": "./dist/mjs/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/mjs/index.d.ts",
"default": "./dist/mjs/index.js"
},
"require": {
"types": "./dist/cjs/src/index.d.ts",
"default": "./dist/cjs/src/index.js"
}
}
},
"files": [
"dist"
],
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"preprepare": "rm -rf dist",
"prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"postprepare": "bash fixup.sh",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "c8 tap",
"snap": "c8 tap",
"format": "prettier --write . --loglevel warn",
"typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts",
"prepublish": "npm run benchclean",
"profclean": "rm -f v8.log profile.txt",
"test-regen": "npm run profclean && TEST_REGEN=1 node --no-warnings --loader ts-node/esm test/00-setup.ts",
"prebench": "npm run prepare",
"bench": "bash benchmark.sh",
"preprof": "npm run prepare",
"prof": "bash prof.sh",
"benchclean": "node benchclean.js"
},
"prettier": {
"semi": false,
"printWidth": 75,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
},
"dependencies": {
"foreground-child": "^3.1.0",
"fs.realpath": "^1.0.0",
"jackspeak": "^2.0.3",
"minimatch": "^9.0.0",
"minipass": "^5.0.0",
"path-scurry": "^1.7.0"
},
"devDependencies": {
"@types/node": "^18.11.18",
"@types/tap": "^15.0.7",
"c8": "^7.12.0",
"memfs": "^3.4.13",
"mkdirp": "^2.1.4",
"prettier": "^2.8.3",
"rimraf": "^4.1.3",
"tap": "^16.3.4",
"ts-node": "^10.9.1",
"typedoc": "^0.23.24",
"typescript": "^4.9.4"
},
"tap": {
"before": "test/00-setup.ts",
"coverage": false,
"node-arg": [
"--no-warnings",
"--loader",
"ts-node/esm"
],
"ts": false
},
"license": "ISC",
"funding": {
"url": "https://github.com/sponsors/isaacs"
},
"engines": {
"node": ">=16 || 14 >=14.17"
}
}

6

dist/mjs/glob.d.ts

@@ -196,5 +196,5 @@ /// <reference types="node" />

* Call `lstat()` on all entries, whether required or not to determine
* whether it's a valid match. When used with {@link withFileTypes}, this
* means that matches will include data such as modified time, permissions,
* and so on. Note that this will incur a performance cost due to the added
* if it's a valid match. When used with {@link withFileTypes}, this means
* that matches will include data such as modified time, permissions, and
* so on. Note that this will incur a performance cost due to the added
* system calls.

@@ -201,0 +201,0 @@ */

{
"version": "10.1.0",
"type": "module"
}

@@ -5,3 +5,4 @@ {

"description": "the most correct and second fastest glob implementation in JavaScript",
"version": "10.1.0",
"version": "10.2.0",
"bin": "./dist/cjs/src/bin.js",
"repository": {

@@ -11,3 +12,3 @@ "type": "git",

},
"main": "./dist/cjs/index.js",
"main": "./dist/cjs/src/index.js",
"module": "./dist/mjs/index.js",

@@ -22,4 +23,4 @@ "types": "./dist/mjs/index.d.ts",

"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
"types": "./dist/cjs/src/index.d.ts",
"default": "./dist/cjs/src/index.js"
}

@@ -65,3 +66,5 @@ }

"dependencies": {
"foreground-child": "^3.1.0",
"fs.realpath": "^1.0.0",
"jackspeak": "^2.0.3",
"minimatch": "^9.0.0",

@@ -68,0 +71,0 @@ "minipass": "^5.0.0",

@@ -146,2 +146,127 @@ # Glob

## Command Line Interface
```
$ glob -h
Usage:
glob [options] [<pattern> [<pattern> ...]]
Expand the positional glob expression arguments into any matching file system
paths found.
-c<command> --cmd=<command>
Run the command provided, passing the glob expression
matches as arguments.
-A --all By default, the glob cli command will not expand any
arguments that are an exact match to a file on disk.
This prevents double-expanding, in case the shell
expands an argument whose filename is a glob
expression.
For example, if 'app/*.ts' would match 'app/[id].ts',
then on Windows powershell or cmd.exe, 'glob app/*.ts'
will expand to 'app/[id].ts', as expected. However, in
posix shells such as bash or zsh, the shell will first
expand 'app/*.ts' to a list of filenames. Then glob
will look for a file matching 'app/[id].ts' (ie,
'app/i.ts' or 'app/d.ts'), which is unexpected.
Setting '--all' prevents this behavior, causing glob to
treat ALL patterns as glob expressions to be expanded,
even if they are an exact match to a file on disk.
When setting this option, be sure to enquote arguments
so that the shell will not expand them prior to passing
them to the glob command process.
-a --absolute Expand to absolute paths
-d --dot-relative Prepend './' on relative matches
-m --mark Append a / on any directories matched
-x --posix Always resolve to posix style paths, using '/' as the
directory separator, even on Windows. Drive letter
absolute matches on Windows will be expanded to their
full resolved UNC maths, eg instead of 'C:\foo\bar', it
will expand to '//?/C:/foo/bar'.
-f --follow Follow symlinked directories when expanding '**'
-R --realpath Call 'fs.realpath' on all of the results. In the case
of an entry that cannot be resolved, the entry is
omitted. This incurs a slight performance penalty, of
course, because of the added system calls.
-s --stat Call 'fs.lstat' on all entries, whether required or not
to determine if it's a valid match.
-b --match-base Perform a basename-only match if the pattern does not
contain any slash characters. That is, '*.js' would be
treated as equivalent to '**/*.js', matching js files
in all directories.
--dot Allow patterns to match files/directories that start
with '.', even if the pattern does not start with '.'
--nobrace Do not expand {...} patterns
--nocase Perform a case-insensitive match. This defaults to
'true' on macOS and Windows platforms, and false on all
others.
Note: 'nocase' should only be explicitly set when it is
known that the filesystem's case sensitivity differs
from the platform default. If set 'true' on
case-insensitive file systems, then the walk may return
more or less results than expected.
--nodir Do not match directories, only files.
Note: to *only* match directories, append a '/' at the
end of the pattern.
--noext Do not expand extglob patterns, such as '+(a|b)'
--noglobstar Do not expand '**' against multiple path portions. Ie,
treat it as a normal '*' instead.
--windows-path-no-escape
Use '\' as a path separator *only*, and *never* as an
escape character. If set, all '\' characters are
replaced with '/' in the pattern.
-D<n> --max-depth=<n> Maximum depth to traverse from the current working
directory
-C<cwd> --cwd=<cwd> Current working directory to execute/match in
-r<root> --root=<root> A string path resolved against the 'cwd', which is used
as the starting point for absolute patterns that start
with '/' (but not drive letters or UNC paths on
Windows).
Note that this *doesn't* necessarily limit the walk to
the 'root' directory, and doesn't affect the cwd
starting point for non-absolute patterns. A pattern
containing '..' will still be able to traverse out of
the root directory, if it is not an actual root
directory on the filesystem, and any non-absolute
patterns will still be matched in the 'cwd'.
To start absolute and non-absolute patterns in the same
path, you can use '--root=' to set it to the empty
string. However, be aware that on Windows systems, a
pattern like 'x:/*' or '//host/share/*' will *always*
start in the 'x:/' or '//host/share/' directory,
regardless of the --root setting.
--platform=<platform> Defaults to the value of 'process.platform' if
available, or 'linux' if not. Setting --platform=win32
on non-Windows systems may cause strange behavior!
-i<ignore> --ignore=<ignore>
Glob patterns to ignore Can be set multiple times
-v --debug Output a huge amount of noisy debug information about
patterns as they are parsed and used to match files.
-h --help Show this usage information
```
## `glob(pattern: string | string[], options?: GlobOptions) => Promise<string[] | Path[]>`

@@ -148,0 +273,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc