@pandino/bundle-installer-nodejs
v0.8.31
Published
Install Bundles defined in the filesystem
Downloads
24
Readme
bundle-installer-nodejs
A Pandino Bundle which can load external Bundles defined in the file-system.
Context
This package is part of the pandino-root monorepo. For detailed information about what is Pandino / how this package fits into the ecosystem, please consult with the related documentation(s).
Usage
Install dependencies
npm install @pandino/pandino @pandino/bundle-installer-nodejs
;
Setup Pandino and the Bundle Installer Bundle
import Pandino from '@pandino/pandino';
import loaderConfiguration from '@pandino/loader-configuration-nodejs';
import bundleInstallerHeaders from '@pandino/bundle-installer-nodejs';
const path = require("path");
const deploymentRoot = path.normalize(path.join(__dirname, 'deploy'));
(async () => {
const app = express();
const port = 3000;
const pandino = new Pandino({
...loaderConfiguration,
'pandino.deployment.root': deploymentRoot,
});
await pandino.init();
await pandino.start();
await pandino.getBundleContext().installBundle(bundleInstallerHeaders);
})();
Detecting Bundles
Based on the config above, the Bundle Installer will detect changes in the ./deploy
folder, and install / uninstall
all Bundles placed under it.
License
Eclipse Public License - v 2.0