MCPcopy Create free account
hub / github.com/TanStack/cli / readTemplateFile

Function readTemplateFile

packages/create/scripts/generate-manifest.mjs:53–64  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

51}
52
53function readTemplateFile(file) {
54 if (binaryExtensions.has(extname(file))) {
55 return `base64::${readFileSync(file).toString('base64')}`
56 }
57
58 const contents = readFileSync(file, 'utf8').toString()
59 if (file.endsWith('.ejs')) {
60 registerTemplate(contents)
61 }
62
63 return contents
64}
65
66function toCleanPath(file, baseDir) {
67 return relative(baseDir, file).replace(/\\/g, '/')

Callers 1

visitFunction · 0.85

Calls 2

registerTemplateFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected