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

@humanwhocodes/gitignore-to-minimatch

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@humanwhocodes/gitignore-to-minimatch

Utility to convert gitignore patterns to minimatch patterns

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @humanwhocodes/gitignore-to-minimatch?

@humanwhocodes/gitignore-to-minimatch is an npm package that converts .gitignore patterns to minimatch patterns. This allows developers to use .gitignore syntax for file matching in other contexts, such as build tools or custom scripts.

What are @humanwhocodes/gitignore-to-minimatch's main functionalities?

Convert .gitignore patterns to minimatch patterns

This feature allows you to convert an array of .gitignore patterns into an array of minimatch patterns. This is useful for reusing .gitignore patterns in other tools that use minimatch for pattern matching.

const { convert } = require('@humanwhocodes/gitignore-to-minimatch');

const gitignorePatterns = [
  '*.log',
  'node_modules/',
  'dist/'
];

const minimatchPatterns = convert(gitignorePatterns);
console.log(minimatchPatterns);

Convert .gitignore file to minimatch patterns

This feature allows you to convert the patterns in a .gitignore file directly into minimatch patterns. This is useful for dynamically loading and converting patterns from a .gitignore file.

const { convertFile } = require('@humanwhocodes/gitignore-to-minimatch');

const minimatchPatterns = convertFile('.gitignore');
console.log(minimatchPatterns);

Other packages similar to @humanwhocodes/gitignore-to-minimatch

Keywords

FAQs

Package last updated on 08 Mar 2022

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