Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main() {
const config = loadConfigOrExit(program.config);
FacebookAdsApi.init(config.access_token);
const pixel = new AdsPixel(config.pixel_id);
const testId = program.testMode ? config.test_id : null;
let batches = [], batch = [];
fs.createReadStream(program.input)
.pipe(csv())
.on('data', data => {
if (!isEmptyObject(data)) {
batch.push(getEventData(data));
if (batch.length == config.batch_size) {
batches.push(batch);
batch = [];
}
}
})
.on('end', async () => {