How to use the ora.start function in ora

To help you get started, we’ve selected a few ora examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron / electron-docs-linter / cli.js View on Github external
// docsPath is required
if (!docsPath) usage('specify a pathname, .e.g ~/my/electron/electron')

// docsPath is relative to current working directory
docsPath = path.join(process.cwd(), docsPath)

// outfile is relative to current working directory
if (outfile) outfile = path.join(process.cwd(), outfile)

// version is required if writing to a file
if (outfile && !version) usage('`version` is required if `outfile` is specified')

// Use a placeholder version if not writing to a file
if (!version) version = '0.0.0'

const spinner = require('ora')('Parsing electron documentation').start()

lint(docsPath, version).then(function (apis) {
  spinner.stop().clear()

  apis.forEach(api => console.error(api.report()))

  if (apis.some(api => !api.valid)) process.exit(1)

  if (outfile) {
    fs.writeFileSync(outfile, JSON.stringify(apis, null, 2))
    console.log(dedent`
      Created ${path.relative(process.cwd(), outfile)}
    `)
  } else {
    console.log(dedent`
      Docs are good to go!\n
github infinitered / gluegun / src / toolbox / print-tools.ts View on Github external
function spin(config?: string | object): any {
  return require('ora')(config || '').start()
}

ora

Elegant terminal spinner

MIT
Latest version published 4 months ago

Package Health Score

81 / 100
Full package analysis