Considering your code with promises in README.md, I wonder if you understand how we use them?
You take the path to the pyramid of doom.
This is the correct way to use promises :
const client = new GlpiRestClient(config.apirest);
client.initSessionByCredentials(config.user.name, config.user.password, config.appToken)
.then((res) => {
// Do your stuff here
return client.getActiveProfile();
})
.then((res) => {
// Do your stuff here
return client.killSession();
})
.catch((err) => {
console.log(err);
});
Considering your code with promises in README.md, I wonder if you understand how we use them? You take the path to the pyramid of doom.
This is the correct way to use promises :
hth