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

cspell-gitignore

Package Overview
Dependencies
Maintainers
1
Versions
200
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cspell-gitignore

Gitignore Glob matcher for cspell

  • 5.12.0-alpha.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
626K
decreased by-5.96%
Maintainers
1
Weekly downloads
 
Created
Source

cspell-gitignore

A library to assist reading and filtering out files matching glob patterns found in .gitignore files.

Install

npm install -S cspell-gitignore

Usage

import { GitIgnore } from 'cspell-gitignore';

// ...

const gitIgnore = new GitIgnore();

const allFiles = glob('**');

const files = await gitIgnore.filterOutIgnored(allFiles);

Logic

  • For each file, search for the .gitignore files in the directory hierarchy.
  • Ignore any files that match the globs found in the .gitignore files.

The .gitignore globs are evaluated from highest to lowest, matching the git behavior.

To prevent searching higher in the directory hierarchy, specify roots:

const gitIgnore = new GitIgnore([process.cwd()]);

Keywords

FAQs

Package last updated on 05 Oct 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