MCPcopy Create free account
hub / github.com/cn-docs/vueuse / updatePackageREADME

Function updatePackageREADME

scripts/utils.ts:155–168  ·  view source on GitHub ↗
({ packages, functions }: PackageIndexes)

Source from the content-addressed store, hash-verified

153}
154
155export async function updatePackageREADME({ packages, functions }: PackageIndexes) {
156 for (const { name, dir } of Object.values(packages)) {
157 const readmePath = join(dir, 'README.md')
158
159 if (!existsSync(readmePath))
160 continue
161
162 const functionMD = stringifyFunctions(functions.filter(i => i.package === name), false)
163 let readme = await fs.readFile(readmePath, 'utf-8')
164 readme = replacer(readme, functionMD, 'FUNCTIONS_LIST').trim().replace(/\r\n/g, '\n')
165
166 await fs.writeFile(readmePath, `${readme}\n`, 'utf-8')
167 }
168}
169
170export async function updateIndexREADME({ packages, functions }: PackageIndexes) {
171 let readme = await fs.readFile('README.md', 'utf-8')

Callers 1

runFunction · 0.90

Calls 2

stringifyFunctionsFunction · 0.85
replacerFunction · 0.85

Tested by

no test coverage detected