Class: GitIgnore
Mutable path predicate composed from root and nested .gitignore files.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GitIgnore(
root):GitIgnore
Parameters
Section titled “Parameters”string | URL
Returns
Section titled “Returns”GitIgnore
Properties
Section titled “Properties”matcher
Section titled “matcher”
readonlymatcher:PathMatcher
Stable composable matcher that observes later set, delete, and clear calls.
readonlyroot:string
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Remove every registered .gitignore.
Returns
Section titled “Returns”void
delete()
Section titled “delete()”delete(
path):boolean
Remove one .gitignore file. Returns whether it was registered.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
get(
path):string|undefined
Return the retained content for a registered .gitignore.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string | undefined
ignores()
Section titled “ignores()”ignores(
path,directory?):boolean
Whether a path is ignored after applying parent then nested rule files.
Parameters
Section titled “Parameters”string
directory?
Section titled “directory?”boolean = false
Returns
Section titled “Returns”boolean
set(
path,content):void
Add or replace one .gitignore file and its in-memory content.
Parameters
Section titled “Parameters”string
content
Section titled “content”string
Returns
Section titled “Returns”void
isFile()
Section titled “isFile()”
staticisFile(path):boolean
Whether path names a .gitignore control file.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
load()
Section titled “load()”
staticload(root,options?):Promise<GitIgnore>
Load every applicable .gitignore beneath root.
Parameters
Section titled “Parameters”string | URL
options?
Section titled “options?”GitIgnoreLoadOptions = {}
Returns
Section titled “Returns”Promise<GitIgnore>
loadSync()
Section titled “loadSync()”
staticloadSync(root,options?):GitIgnore
Synchronous counterpart to GitIgnore.load.
Parameters
Section titled “Parameters”string | URL
options?
Section titled “options?”GitIgnoreLoadOptions = {}
Returns
Section titled “Returns”GitIgnore