Skip to content

Finds files in a directory that are not ignored by .gitignore files in the filesystem

Notifications You must be signed in to change notification settings

possibilities/find-project-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Find project files CircleCI

Finds files in a directory that are not ignored by .gitignore files in the filesystem

Usage

findProjectFiles(rootPath: string, globalIgnorePatterns = [])

const findProjectFiles = require('find-project-files')

const files = findProjectFiles('/path/to/git/based/project')
console.info(files) //-> ['index.js', 'foo.js', 'bar.js'...]

const filesWithoutFoo =
  findProjectFiles('/path/to/git/based/project', ['foo.js'])
console.info(filesWithoutFoo) //-> ['index.js', 'bar.js'...]

const filesWithoutFooBar =
  findProjectFiles('/path/to/git/based/project', ['foo.js', 'bar.js'])
console.info(filesWithoutFooBar) //-> ['index.js'...]

checkIsProjectFilePath(rootPath: string, filePath: string, globalIgnorePatterns = [])

const { checkIsProjectFilePath } = require('find-project-files')

const isProjectFile = checkIsProjectFilePath(
  '/path/to/git/based/project',
  '/path/to/git/based/project/index.js'
)
console.info(isProjectFile) //-> true

const isIgnoredProjectFile = checkIsProjectFilePath(
  '/path/to/git/based/project',
  '/path/to/git/based/project/ignored.js'
)
console.info(isIgnoredProjectFile) //-> false

const isProjectFileExceptFoo = checkIsProjectFilePath(
  '/path/to/git/based/project',
  '/path/to/git/based/project/foo.js',
  ['foo.js']
)
console.info(isProjectFileExceptFoo) //-> false

About

Finds files in a directory that are not ignored by .gitignore files in the filesystem

Resources

Stars

Watchers

Forks

Packages