istavrit
v0.0.4
Published
Istavrit is a runtime task runner.
Downloads
6
Readme
Istavrit
Istavrit ile düzenli task yönetimi
Tasklarınızı runtime'da çalıştırın.
Yükleme Yönergeleri
Yüklemek için Node.js v4.5+ gereklidir.
$ npm install --save istavrit
Kütüphane ile Gelen Özellikler
Tasklarınıza hükmedin.
'use strict';
let <isim> = require('istavrit');
// Projemize ekliyoruz.
<isim>.addTask(/* task1,task2,task3 */);
// Eklenen tasklar fonksiyon olmak zorundadır.
<isim>.run();
// Taskları sırayla çalıştırır.
<isim>.delayRun(/* saniye */);
// Taskların arasına fonksiyon ile verilen saniye kadar aralık koyar. *İlk fonksiyon hemen başlar
<isim>.delete();
// Bütün taskları siler.
Örnek Kullanım
Aşağıda kütüphanenin örnek tasklar ile kullanımı verilmiştir.
'use strict';
let Istavrit = require('istavrit');
function fn1() {
console.log('Task - 1');
}
function fn2() {
console.log('Task - 2');
}
function fn3() {
console.log('Task - 3');
}
Istavrit.addTask(fn1,fn2,fn3);
Istavrit.run();
// Task - 1
// Task - 2
// Task - 3
Istavrit.delayRun(1);
// Task - 1
// 1 saniye sonra...
// Task - 2
// 1 saniye sonra...
// Task - 3