generic-text-linker
Version:
Generic text linker for NodeJs
22 lines (19 loc) • 546 B
JavaScript
const readdir = require('recursive-readdir-sync')
module.exports = exports = function (rootDir) {
const files = readdir(rootDir)
const blackList = ['.git', '.svn', 'node_modules', 'dist', 'tests/fixtures']
const fileList = []
files.forEach(function (file) {
let blackListed = false
blackList.forEach(function (pathPart) {
if (blackListed && file.includes(pathPart)) {
blackListed = true
}
})
/* istanbul ignore else */
if (!blackListed) {
fileList.push(file)
}
})
return fileList
}