var pg = require('pg'); function onConnect(err, client, done) { if (err) { console.error(err); process.exit(1); } client.end(); } exports.connTest = function () { pg.connect(Connections.pg_sjy_eco, function (err, db) { if (err) { console.log(err); process.exit(0); } else { console.log('pg conn ok'); } }); };