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

parse-gitignore

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-gitignore

Parse a .gitignore or .npmignore file into an array of patterns.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
578K
decreased by-10.72%
Maintainers
1
Weekly downloads
 
Created

What is parse-gitignore?

The parse-gitignore npm package is used to parse .gitignore files and return an array of patterns specified in the file. This can be useful for various tasks such as filtering files, generating ignore lists, or integrating with other tools that need to respect .gitignore rules.

What are parse-gitignore's main functionalities?

Parse .gitignore file

This feature allows you to read and parse a .gitignore file, returning an array of patterns specified in the file. This can be useful for filtering files or integrating with other tools.

const parseGitignore = require('parse-gitignore');
const fs = require('fs');

const gitignoreContent = fs.readFileSync('.gitignore', 'utf8');
const patterns = parseGitignore(gitignoreContent);
console.log(patterns);

Parse .gitignore from a string

This feature allows you to parse .gitignore content from a string, which can be useful if you have the content in memory or from another source.

const parseGitignore = require('parse-gitignore');

const gitignoreContent = 'node_modules\n.DS_Store\n';
const patterns = parseGitignore(gitignoreContent);
console.log(patterns);

Other packages similar to parse-gitignore

Keywords

FAQs

Package last updated on 14 May 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