1.0.0 • Published 7 years ago
gitattributes-globs v1.0.0
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-ignoreindex.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 testLicense
MIT © John Blackbourn