New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

gitattributes-globs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitattributes-globs

Parse a .gitattributes file and return its export-ignore entries as an array of glob patterns.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
6
-25%
Maintainers
1
Weekly downloads
 
Created
Source

gitattributes-globs

Parse the export-ignore entries in a .gitattributes file into an array of glob patterns.

Makes use of gitignore-globs by Bernhard Wanger.

Usage

.gitattributes:

node_modules export-ignore
package.json export-ignore

index.js:

var parse = require('gitattributes-globs');

var globs = parse('.gitattributes');

console.log(globs);
// Result: ['node_modules', '**/node_modules/**', 'package.json']

API

parse([filepath], [options])

  • filepath (string; default: process.cwd() + '.gitattributes') - Path to your .gitattributes.
  • options (array) - Options see below.

Options:

{
    negate: false
}
  • negate (bool; default: false) - Option to negated patterns. Example: package.json => !package.json

Rules

This package utilises gitignore-globs. Read that package's readme for information about glob pattern rules.

Test

npm test

License

MIT © John Blackbourn

Keywords

gitattributes

FAQs

Package last updated on 05 Feb 2019

Related posts