MCPcopy Create free account
hub / github.com/breck7/scroll / fromFolder

Method fromFolder

external/.scrollLibs.js:17861–17871  ·  view source on GitHub ↗
(folderPath, filepathPredicate = filepath => filepath !== ".DS_Store")

Source from the content-addressed store, hash-verified

17859 return methods[format](content)
17860 }
17861 static fromFolder(folderPath, filepathPredicate = filepath => filepath !== ".DS_Store") {
17862 const path = require("path")
17863 const fs = require("fs")
17864 const particle = new Particle()
17865 const files = fs
17866 .readdirSync(folderPath)
17867 .map(filename => path.join(folderPath, filename))
17868 .filter(filepath => !fs.statSync(filepath).isDirectory() && filepathPredicate(filepath))
17869 .forEach(filePath => particle.appendLineAndSubparticles(filePath, fs.readFileSync(filePath, "utf8")))
17870 return particle
17871 }
17872}
17873Particle._parserPoolsCache = new Map()
17874Particle.ParserPool = ParserPool

Callers

nothing calls this directly

Calls 5

forEachMethod · 0.80
mapMethod · 0.80
filterMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected