Inquirer.js: Is there any way to use 'environment variables' instead of interactive input

Created on 15 Feb 2019  路  1Comment  路  Source: SBoudrias/Inquirer.js

Check the environment variables, if it exists user does not need to input.

Most helpful comment

const gimmeMahVariable = _ =>
  process.env.yourVariable
    ? Promise.resolve(process.env.yourVariable)
    : inquirer.prompt({
      // stuff...
    })

gimmeMahVariable()
  .then(_mahVariable => // ...

>All comments

const gimmeMahVariable = _ =>
  process.env.yourVariable
    ? Promise.resolve(process.env.yourVariable)
    : inquirer.prompt({
      // stuff...
    })

gimmeMahVariable()
  .then(_mahVariable => // ...
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mrooze-zeng picture Mrooze-zeng  路  5Comments

jahvi picture jahvi  路  6Comments

Ezekiel-DA picture Ezekiel-DA  路  7Comments

adalinesimonian picture adalinesimonian  路  6Comments

alex-ppg picture alex-ppg  路  3Comments