Newer
Older
let injected = require('./injected');
let methods = require('./methods');
let utils = require('./utils');
let actualApp;
async function init(config = {}) {
if (actualApp) {
return;
}
global.fetch = require('node-fetch');
actualApp = bundle.lib;
injected.send = bundle.lib.send;
return bundle.lib;
}
async function shutdown() {
if (actualApp) {
await actualApp.send('close-budget');
actualApp = null;
}
}
module.exports = {
init,
shutdown,
utils,
internal: bundle.lib,