{"size": 941, "ext": "js", "max_stars_repo_path": "es6/promise.js", "max_stars_repo_name": "nuri-engin/node-egitimi", "max_stars_repo_stars_event_min_datetime": "2017-12-31T12:12:42.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-02T12:18:56.000Z", "max_issues_repo_path": "es6/promise.js", "max_issues_repo_name": "speccin/node-egitimi", "max_issues_repo_issues_event_min_datetime": "2019-03-11T22:40:08.000Z", "max_issues_repo_issues_event_max_datetime": "2019-03-15T21:58:41.000Z", "max_forks_repo_path": "es6/promise.js", "max_forks_repo_name": "speccin/node-egitimi", "max_forks_repo_forks_event_min_datetime": "2018-01-12T11:58:26.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-16T11:12:55.000Z"}
{"max_stars_count": 138, "max_issues_count": 1, "max_forks_count": 353, "avg_line_length": 22.4047619048, "max_line_length": 55, "alphanum_fraction": 0.51434644}
/*const asenkronFonksiyon = function (sayi, callback) {
    const sonuc = sayi + 2;
    callback(sonuc);
};

asenkronFonksiyon(2, function (sonuc) {
    console.log(sonuc);
    asenkronFonksiyon(4, function (sonuc) {
        console.log(sonuc);
        asenkronFonksiyon(6, function (sonuc) {
            console.log(sonuc);
            asenkronFonksiyon(8, function (sonuc) {
                console.log(sonuc);
            })
        })
    })
});*/

const asenkronFonksiyon = (sayi) => {
  return new Promise((resolve, reject) => {
      if (sayi === 4)
          resolve("her şey yolunda!");
      else
          reject('bir sorun var abim!');
  })
};

asenkronFonksiyon(5)
    .then((data) => {
        console.log(data);
        return 1;
    })
    .then((data) => {
        console.log(data);
        return 2;
    })
    .then((data) => {
        console.log(data);
    })
    .catch((error) => {
        console.log(error);
    });