Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

picomatch

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

picomatch

Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.

  • 2.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
57M
decreased by-13.09%
Maintainers
4
Weekly downloads
 
Created

What is picomatch?

The picomatch npm package is a minimal matching utility that uses glob patterns to test, match, or parse strings. It is designed to be a faster and lighter alternative to other pattern matching libraries, with a focus on performance and accuracy.

What are picomatch's main functionalities?

Glob matching

Use picomatch to create a matcher function for glob patterns, which can then be used to test if strings match the pattern.

const picomatch = require('picomatch');
const isMatch = picomatch('*.js');
console.log(isMatch('file.js')); // true
console.log(isMatch('file.txt')); // false

Multiple patterns

Create a matcher function that can handle multiple patterns, including negation patterns, to match against strings.

const picomatch = require('picomatch');
const isMatch = picomatch(['*.js', '!foo.js']);
console.log(isMatch('file.js')); // true
console.log(isMatch('foo.js')); // false

Parse glob patterns

Parse glob patterns to analyze their structure and components, which can be useful for understanding the pattern or for further processing.

const picomatch = require('picomatch');
const result = picomatch.parse('*.js');
console.log(result);

Other packages similar to picomatch

Keywords

FAQs

Package last updated on 10 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc