import Batch = require("nativescript-batch");

var b = Batch.newBatch(function(ctx) {
    console.log("Batch name: " + ctx.batchName);
});

b.batchName = "My batch";

b.start();