MCPcopy Create free account
hub / github.com/serverless/examples / SERVERLESS_EXAMPLE_TABLE

Function SERVERLESS_EXAMPLE_TABLE

generate-readme.js:60–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 <!-- AUTO-GENERATED-CONTENT:END -->
59 */
60 SERVERLESS_EXAMPLE_TABLE() {
61 const examplesPath = path.join(__dirname, "examples.json");
62 const examples = JSON.parse(fs.readFileSync(examplesPath, "utf8"));
63
64 // Make table header
65 let md = "| Example | Runtime |\n";
66 md += "|:--------------------------- |:-----|\n";
67 examples.forEach((example) => {
68 const dirname = example.dirname || "";
69 const exampleUrl = `https://github.com/serverless/examples/tree/master/${dirname}`;
70 const runtime = getRuntime(dirname);
71 const description = example.description
72 ? `<br/> ${example.description}`
73 : "";
74 // add table rows
75 md += `| [${
76 example.title || formatPluginName(example.name)
77 }](${exampleUrl}) ${description} | ${runtime} |\n`;
78 });
79
80 return md;
81 },
82 },
83};
84

Callers

nothing calls this directly

Calls 2

getRuntimeFunction · 0.85
formatPluginNameFunction · 0.85

Tested by

no test coverage detected