INNER CODE UNIT · JavaScript

buildLibWithDocs

codeceptjs/CodeceptJS · Bunoshfile.js:171

export async function buildLibWithDocs(forTypings = false) {
  task.stopOnFailures()
  const files = fs.readdirSync('lib/helper').filter(f => path.extname(f) === '.js')
  ensureDir('docs/build')

  const partials = fs.readdirSync('docs/webapi').filter(f => path.extname(f) === '.mustache')
  const placeholders = partials.map(file => `{{> ${path.basename(file, '.mustache')} }}`)
  const templates = partials
    .map(file => fs.readFileSync(`docs/webapi/${file}`).toString())
    .map(template =>
      template
        .replace(/^/gm, '   * ')
        .replace(/^/, '\n')
        .replace(/\s*\* /, ''),
    )

  for (const file of files) {
    const name = path.basename(file, '.js')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…