gitattributes-globs

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i gitattributes-globs

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

3.92 kB

Total Files

4

Last publish

Collaborators

  • johnbillion