old_contents: 'use strict';
  
  const axios = require('axios');
  const cheerio = require('cheerio');
  const inquirer = require('inquirer');
  
  const baseUrl = "http://www.liburnasional.com/kalender-2017/";
  
  var holidays = [];
  
  axios.get(baseUrl).then(res => {
      var $ = cheerio.load(res.data);
      // get data
      $('.libnas-calendar-holiday-title').each(function(x, y) {
          holidays.push({
              day     : y.children[1].children[0].data,
              date    : y.children[2].children[0].data,
              title   : y.children[0].children[0].children[0].children[0].data,
          });
      });
      return holidays;
  }).then(holidays => {
      var currentYear = new Date().getFullYear(); //get current Year
      var years       = [];
      
      // get lists years, five years from current year
      for (var i = 0; i < 5; i++) {
          var temp = currentYear+i;
          years.push(temp.toString());
      }
  
      return inquirer.prompt([{
          type    : "list",
          name    : "data",
          message : "Pilih Tahun: ",
          choices : years
      }]);
  }).then(answer => {
      // console.log("ntak");
  });
  
new_contents: 'use strict';
  
  const axios = require('axios');
  const cheerio = require('cheerio');
  const inquirer = require('inquirer');
  
  const listYears     = "http://www.liburnasional.com/";
  const holidaysUrl   = "http://www.liburnasional.com/kalender-";
  
  var holidays = [];
  
  axios.get(listYears).then(res => {
      var $ = cheerio.load(res.data);
      var root = $('.dropdown-menu').eq(0).children().children();
      var years = [];
  
      root.each(function(x, y) {
          years.push({name: y.children[0].data, link: y.attribs.href});
      });
  
      return inquirer.prompt([{
          type    : "list",
          name    : "years",
          message : "Pilih Tahun: ",
          choices : years
      }]);
  }).then(answer => {
      var year = answer.years.split(" ");
      return year[year.length - 1];
  });
  
subject: refactor processing get data