{"size": 1133, "ext": "js", "max_stars_repo_path": "generators/app/index.js", "max_stars_repo_name": "phlogisticfugu/generator-nuxt-express-serverless", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "generators/app/index.js", "max_issues_repo_name": "phlogisticfugu/generator-nuxt-express-serverless", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "generators/app/index.js", "max_forks_repo_name": "phlogisticfugu/generator-nuxt-express-serverless", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.7884615385, "max_line_length": 92, "alphanum_fraction": 0.5763459841}
'use strict';
const Generator = require('yeoman-generator');
const chalk = require('chalk');
const yosay = require('yosay');

module.exports = class extends Generator {
  prompting() {
    // Have Yeoman greet the user.
    this.log(
      yosay(`Welcome to the ${chalk.green('generator-nuxt-express-serverless')} generator!`)
    );

    const prompts = [
      {
        type: 'input',
        name: 'appname',
        message: 'What is your app/project name?',
        default: this.appname
      },
      {
        type: 'input',
        name: 'appdescription',
        message: 'Description for your project'
      }
    ];

    return this.prompt(prompts).then(props => {
      // To access props later use this.props.someAnswer;
      this.props = props;
    });
  }

  writing() {
    this.fs.copyTpl(
      this.templatePath('package.json.ejs'),
      this.destinationPath('package.json'),
      {
        appname: this.answers.appname,
        appdescription: this.answers.appdescription
      }
    );
  }

  install() {
    this.installDependencies({
      bower: false,
      npm: false,
      yarn: true
    });
  }
};
