How to use the username function in username

To help you get started, we’ve selected a few username 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 beakerbrowser / bkr / lib / subcommands.js View on Github external
export async function initArchive(rpc, dir) {
  // check if the dir is valid
  await isDirInitable(dir)

  // ask user questions
  console.log(trim`
    Initializing ${dir}

    This utility will walk you through creating a dat.json file.
    It only covers the most common items, and tries to guess sensible defaults.
  `)
  const q = (name, message, def, type='input') => ({ name, message, 'default': def, type })
  var answers = await inquirer.prompt([
    q('title', 'title:', path.basename(dir)),
    q('description', 'description:'),
    q('author', 'author:', await username())
  ])
  console.log(`\nAbout to write ${path.join(dir, 'dat.json')}\n`)
  console.log(JSON.stringify(answers, null, 2), '\n')
  var confirm = await inquirer.prompt([{ type: 'confirm', name: 'ok', message: 'Is this ok?', default: true }])
  if (!confirm.ok) {
    console.log('Aborted.')
    process.exit(0)
  }

  // create site in beaker
  var datKey = await rpc.createNewArchive(answers)
  console.log(trim`
    Created new site
    dat://${datKey}/
  `)
github electron-userland / electron-forge / packages / template / base / src / determine-author.ts View on Github external
export default async (dir: string) => (await getAuthorFromGitConfig(dir)) || username();

username

Get the username of the current user

MIT
Latest version published 6 months ago

Package Health Score

70 / 100
Full package analysis