How to use the firebase-tools.projects function in firebase-tools

To help you get started, we’ve selected a few firebase-tools 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 firebase / firebase-js-sdk / tools / config.js View on Github external
const project = await (async () => {
      if (projectId) return projectId;

      const projects = await firebaseTools.projects.list({ token });
      const response = await inquirer.prompt([
        {
          type: 'list',
          name: 'projectId',
          message: 'Which project would you like to use to test?',
          choices: projects
            .sort(project =>
              project.name.toLowerCase().includes('jscore') ? -1 : 1
            )
            .map(project => ({
              name: `${project.displayName} (${project.projectId})`,
              value: project
            }))
        }
      ]);