Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
transform.read(path, true).then(result => {
console.log(JSON.stringify({ features: transform.transform(result, opt.lat, opt.lon, opt.alt), type: "FeatureCollection" }, null, 3)); //Converted json object from csv data
});
});
program
.command('shp2geo
.then(() => {;
console.log('Success!');
prompt.stop();
});
}
}, function (err, result) {
if (err) {
console.log('Error getting prompt:',err);
} else if (result.confirm === 'CONTINUE') {
prompt.stop();
console.log('Getting list of records to delete');
maindb.list(function(err, results) {
if (!err) {
results.rows.forEach(function(result) {
var recordToDelete = {
'_id': result.id,
'_rev': result.value.rev,
'_deleted': true
};
recordsToDelete.push(recordToDelete);
});
if (recordsToDelete.length > 0) {
console.log('About to delete ' + recordsToDelete.length + ' records.');
maindb.bulk({ docs: recordsToDelete}, function(err, results) {
if (err) {
console.log('Error deleting records.', JSON.stringify(err, null, 2));
}catch(error){
console.log(error.message);
}
});
}
program
.command('verify')
.arguments('[env]')
.description('Verify credentials')
.action(function (env, options) {
common.verify();
});
prompter.stop();
program.parse(process.argv);
if (!program.args.length) {
setUserPass();
} else {
common.validate(["help","set","verify","account"], [process.argv[2]], program);
}
process.on('uncaughtException', error => {
console.log(error.message);
});
prompt.get(args, (err, argv) => {
prompt.stop();
if (argv.username) {
this.api.user = {
username: argv.username,
password: argv.password
};
}
return run(argv);
});
prompt.get(args, (err, argv) => {
if (err) throw err;
prompt.stop();
if (argv.hecate_username) {
self.api.user = {
username: argv.hecate_username,
password: argv.hecate_password
};
}
return main();
});
} else {
prompt.get(args, (err, argv) => {
if (err) throw err;
prompt.stop();
if (argv.hecate_username) {
self.api.user = {
username: argv.hecate_username,
password: argv.hecate_password
};
}
options.limit = argv.limit;
return main();
});
} else {
}, function (err, result) {
if (err) {
throw new Error('Must select a service to continue');
}
prompt.stop();
_opts.serviceName = result.serviceName;
_opts.service = def[result.serviceName];
callback();
});
};
prompt.get(args, (err, argv) => {
prompt.stop();
if (argv.username) {
this.api.user = {
username: argv.username,
password: argv.password
};
}
return run(argv);
});
promisePrompt.close = function(){
prompt.stop()
}