Scan your whole stack
From OX Research Newsroom
Are you using picomatch?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v4.0.7
picomatch was last scanned on 24 Aug 2026 at version 4.0.7. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 4.0.7 LATEST | 24 Aug 2026 | No rules fired |
Findings for v4.0.7. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 4.0.7; other versions have their own rules, not their own score.
0 CRITICAL 1 HIGH 1 MEDIUM 0 LOW
Seal Security ships a patched build of this package. Its fixed versions:
The publisher’s own README, as collected from the registry.
* and ?), globstars (**) for nested directories, advanced globbing with extglobs, braces, and POSIX brackets, and support for escaping special characters with \ or quotes.See the library comparison to other libraries.
(TOC generated by verb using markdown-toc)
Install with npm:
npm install --save picomatch
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
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
// For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
const picomatch = require('picomatch/posix');
// the same API, defaulting to posix paths
const isMatch = picomatch('a/*');
console.log(isMatch('a\\b')); //=> false
console.log(isMatch('a/b')); //=> true
// you can still configure the matcher function to accept windows paths
const isMatch = picomatch('a/*', { options: windows });
console.log(isMatch('a\\b')); //=> true
console.log(isMatch('a/b')); //=> true
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' }
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
Returns true if any of the given glob patterns match the specified string.
Params
returns {Boolean}: Returns true if any patterns match strExample
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 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 a glob pattern to separate the pattern into segments.
Params
input {String}: Glob pattern to scan.options {Object}returns {Object}: Returns an object withExample
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 }
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}Example
const picomatch = require('picomatch');
const state = picomatch.parse('*.js');
// picomatch.compileRe(state[, options]);
console.log(picomatch.compileRe(state));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
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');
// picomatch.makeRe(state[, options]);
const result = picomatch.makeRe('*.js');
console.log(result);
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
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)$/
The following options may be used with the main picomatch() function or any of the methods on the picomatch API.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.