find-project-files

0.0.4 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    1
  • 0.0.3
    1
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i find-project-files

Weekly Downloads

2

Version

0.0.4

License

MIT

Unpacked Size

124 kB

Total Files

7

Last publish

Collaborators

  • possibilities