Comments (5)
But I can think for a similar feature for a next release...as usual any help/PR is appreciated!
from live-plugin-manager.
This is the expected behavior.
The idea is that the local plugin folder is just a cache. So if you install again a dependency no new files is downloaded, but I suggest to store the list of plugins somewhere else (like in a database).
This is also required when you have your app scaled to multiple instances: some instances can be new, with the directory empty.
You can always reinstall that files from filesystem if you want to just reuse that.
What do you think?
from live-plugin-manager.
Thanks for quick reply. i know that expected behavior but optionaly supporting a method for scan cache folder would be nice.
So in my case stateless worker client app, managed remotely. i install and update packages when required except this, i want to keep working app even it crashes and restarts automaticaly without any state restore or check dependencies.
bellow code works for me now i've written temporary. something like lpm.scan()
method in the library with better implementation can be helpfull.
const fs = require("fs"), lpm = new(require('live-plugin-manager')).PluginManager(),
setTimeout(async () => {
const packages = fs.readdirSync(lpm.options.pluginsPath, {
withFileTypes: true
})
.filter(dirent => dirent.isDirectory())
.map(dirent => dirent.name)
packages.forEach(async (package) => lpm.installedPlugins.push(await lpm.createPluginInfo(package)));
setTimeout(() => console.log('PACKAGES', packages, lpm.list()), 1000);
}, 0);
make sense?
from live-plugin-manager.
I suggest to store the list of the installed plugins in a custom storage. It can be a simple text file. And at startup just read this file and install all.
Otherwise you can have some side effects. For example if you want to install plugin A, but it depends on B, you will end up with 2 plugins, while logically the plugins is only 1.
The code seems to be correct, but not officially supported ;-).
from live-plugin-manager.
Closing this issue for now. We can then open a new one more specific, I think something like: "Allow to re install plugins from file system cache"
from live-plugin-manager.
Related Issues (20)
- 'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead. HOT 3
- 0.14.1 -> 0.15.1 issue on 0.15.1 HOT 2
- no such file or directory, mkdir '/plugin_packages' HOT 4
- getInfo should load the package from disk HOT 2
- Proxy settings for NPM registry HOT 1
- Support loading plugins without FS access HOT 1
- fix: circular dependencies result in endless loop + out of memory crash HOT 3
- Plugin manager require gives module not found but passing the path directly works HOT 4
- Plugin manager gives an error requiring aws-sdk HOT 3
- sharp lib install failed HOT 2
- Error when using require to load an ES6 module HOT 7
- PluginManager.install is not compatible with NodeJS workers HOT 1
- Literal Object prototype is not working properly inside the plugin's context HOT 9
- Module not found: Can't resolve 'console' in React HOT 2
- Error: Invalid plugin github repository HOT 2
- Improper Error handling HOT 1
- PluginVm.getScopedInfo could not get the correct scope if it contains a dot HOT 1
- Handling modules with index.json entrypoints HOT 2
- FR: Support for `"exports"` in `package.json` HOT 1
- Error: Code generation from strings disallowed for this context HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from live-plugin-manager.