With the attached .gitignore, the following code will return false
const ig = ignore.default();
ig.add(fs.readFileSync('.gitignore').toString());
console.log(ig.ignores('node_modules'));
I believe it's because of the BOM at the beginning of the file.
gitignore.zip