ignore
7.0.16 · 17 Nov 2026MIT456.9M / weekRepositoryHomepagenpmAtom feed
109 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 7.x · latest line
7.0.8
31 Aug 2026PATCH A backslash now makes the next character a literal, exactly as
gitdoes:\*matches a literal*rather than acting as a wildcard,\?matches a literal?, and\d,\b,\/and the like are the plain characters instead of regular-expression escapes.PATCH Only a trailing run of spaces is stripped from a pattern — never tabs or other whitespace — and a line of only tabs is treated as a pattern rather than a blank line, matching
git.
PATCH Brings pattern matching closer to
git:PATCH A backslash now makes the next character a literal, exactly as
gitdoes:\*matches a literal*rather than acting as a wildcard,\?matches a literal?, and\d,\b,\/and the like are the plain characters instead of regular-expression escapes.PATCH Only a trailing run of spaces is stripped from a pattern — never tabs or other whitespace — and a line of only tabs is treated as a pattern rather than a blank line, matching
git.
An upgrade is recommended for all dependents.
7.0.4
25 Apr 2025PATCH Allows files named
.{3,}, such as...for Linux / macOS
PATCH Allows files named
.{3,}, such as...for Linux / macOS
ig.ignores('...') ig.ignores('....') // It will throw a RangeError in versions prior to 7.0.4, but it is ok if >= 7.0.4An upgrade is recommended for all dependents
7.0.0
23 Dec 2024The primary feature introduced by
7.0.0is the.checkIgnore()method, which is most equivalent togit check-ignore -v. And also it allows to pass{pattern, mark?}as the parameter of.add()so that we could imitate the mechanism ofgit check-ignoreas:Minor feature
The primary feature introduced by
7.0.0is the.checkIgnore()method, which is most equivalent togit check-ignore -v. And also it allows to pass{pattern, mark?}as the parameter of.add()so that we could imitate the mechanism ofgit check-ignoreas:ig.add({ pattern: 'foo/*', mark: '60' }) const { ignored, rule } = checkIgnore('foo/') if (ignored) { console.log(`.gitignore:${result}:${rule.mark}:${rule.pattern} foo/`) } // .gitignore:60:foo/* foo/Potential Incompatibilities
The only situation that
7.0.0might bring incompatibility is to.add()a< 7.0.0instance into a>= 7.0.0instance, which might occur when the current workspace has multiplenode-ignoreversions installed, please be careful.const {anotherIgnoreInstance} = require('./ignore-6.0-instance') // A 7.0.0 instance ignore().add(anotherIgnoreInstance) // It will break your codeOtherwise, in most cases, if you never do something above or there is only one version of
node-ignoreinstalled in the current workspace, it is quite safe to upgrade to7.0.0.- 6.x
6.0.2
17 Sep 20246.0.1
17 Sep 2024The release of
6.xis due to a mistake.Making an upgrade from
5.xto 6.x for now actually changes nothing and does no harm, everyone could just upgrade or ignore the version.The next major release will be
7.0.0
6.0.0
17 Sep 2024- 5.x
5.3.0
16 Nov 2023MINOR export
Optionsinterface
MINOR export
Optionsinterface
An upgrade is safe for all dependents
It allows typing external methods which expect
Optionsas a param, by importing theOptionsinterface.import {Options} from 'ignore'5.2.4
19 Dec 2022PATCH fixes normal single asterisk and normal consecutive asterisks defined in gitignore spec
PATCH invalid trailing backslash will not throw unexpectedly
PATCH fixes normal single asterisk and normal consecutive asterisks defined in gitignore spec
PATCH invalid trailing backslash will not throw unexpectedly
An upgrade is recommended for all dependents
The following rules could be not properly parsed with previous
ignoreversions**foo *bar qu*ux abc\ # `ignore` would throw if no whitespace after `\`
5.2.0
19 Dec 2021PATCH support readonly arrays of typescript.
MINOR bring backward compatibility with relative paths.
PATCH support readonly arrays of typescript.
MINOR bring backward compatibility with relative paths.
An upgrade is recommended for all dependents.
ignore().ignores('../foo/bar.js') // will throwAnd the code below will not throw, however it is not recommended
ignore({ allowRelativePaths: true }).ignores('../foo/bar.js')Recommend:
ignore().ignores('foo/bar.js')5.1.9
3 Nov 2021PATCH fixes
ignorecasewhen internal cache is hit.
PATCH fixes
ignorecasewhen internal cache is hit.
An upgrade is recommended for all dependents.
5.1.5
22 May 2020PATCH fixes escaping for square brackets
PATCH fixes escaping for square brackets
An upgrade is recommended for all dependents.
5.1.4
14 Aug 20195.1.3
14 Aug 2019PATCH apply the changes of gitignore rules 2.22.1 and fix #56
PATCH apply the changes of gitignore rules 2.22.1 and fix #56
An upgrade is recommended for all dependents.
5.1.2
28 May 20195.1.1
17 Apr 2019PATCH fixes
isPathValidon Windows
PATCH fixes
isPathValidon Windows
On Windows, if
pathis an absolute path,ig.ignores(path),ig.test(path)and related methods will now throw an error as expected.5.1.0
14 Apr 2019FEATURE: Typescript: export interface Ignore
5.0.4
3 Nov 2018PATCH: fixes isPathValid in windows
5.0.1
14 Aug 2018PATCH: fixes for windows.
PATCH: improves tests for typescript and windows.
5.0.0
13 Aug 2018SEMVER-MAJOR: #20: it will throw if an invalid pathname passes into
.ignores(pathname), see Upgrade 4.x -> 5.x.FEATURE: #31: adds a new method
.test(pathname).BENCHMARK: improves performance by 26%.
- 4.x
4.0.6
12 Aug 2018PATCH:
Object.prototypemethods will not ruin the result any more.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.