Open jhorbulyk opened 4 years ago
I used next snippet for solving the issue:
async function run(msg, cfg, snapshot) {
const { user, password } = cfg;
const buf = require('buffer').Buffer;
const auth = buf(`${user}:${password}`).toString('base64');
this.logger.info(auth);
}
Consider the following code:
One would expect it to produce a message
{message: 'YWJj'}
. However, instead it producesbecause we forgot to bring
Buffer
and some other Node globals into the context in which the code is executed.