Below is for jkdb
const { QConnection } = require(“jkdb”);
const q = new QConnection({ host : “Office_Server_URL”,port: 5000, user: “user”, password: “password” });
q.connect((err) => {
if (err) throw err;
console.log(“connected”);
// send query from here
});
Below is for node-q
const q = require(‘node-q’);
const connectionDetails = {
host : ‘Office_Server_URL’,
port : 5000,
user : ‘username’,
password : ‘password’};
q.connect(connectionDetails)
.then((conn) => {
return conn.k(’til 3′);
})
.then ((result) => {
console.log(‘res : ‘+result);
q.disconnect();
})
.catch((err) => {
console.log(‘Error : ‘+err);
});