MCPcopy
hub / github.com/typescript-cheatsheets/react / readContentFromPath

Function readContentFromPath

genReadme.mjs:26–37  ·  view source on GitHub ↗
(relativePath)

Source from the content-addressed store, hash-verified

24};
25
26async function readContentFromPath(relativePath) {
27 let MdDoc = await fs.readFile(path.join(repositoryRootPath, relativePath), {
28 encoding: "utf8",
29 });
30 let MdContent = Fm(MdDoc.toString());
31 let TableOfContents = Toc(MdContent.body).content;
32 return {
33 frontmatter: MdContent.attributes,
34 body: MdContent.body,
35 toc: TableOfContents,
36 };
37}
38
39async function updateSectionWith(options) {
40 const {

Callers 1

updateSectionWithFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected