Node.js VM: Developing an External Plugin System Within Your Web App
summary
Shows a working external plugin system that runs third‑party code inside the host using the Node.js vm module: plugin source is compiled to a vm.Script, executed in a context that supplies a custom require, mock process, logger and an export object. Plugins are delivered as a scaffolded app class that receives controlled dependencies; code and bundled npm deps are persisted so apps load on restart. Notes: promises can escape timing, vm is not a security boundary, reviews or separate processes are needed.
AI-written summary · about
chapters (13)
- 0:00Introduction and setup
- 1:47Why external plugins matter
- 6:28Environment requirements for plugins
- 9:42Node.js VM module basics
- 13:14Plugin structure and dependencies
- 16:13Compiling and executing plugins
- 23:16Plugin persistence and startup
- 24:43Interacting with plugin methods
- 28:19Extending app functionality with plugins
- 30:02Caveats of the VM approach
- 32:34Security limitations of VM module
- 34:20Summary and closing remarks
- 35:47Q&A session
related talks
24mRunning plugins within a web app
07mBuilding a Node js runtime for the browser
46mThe journeyman’s guide to modules in Node.js
15mWrite once, run anywhere - cross-env JS
36mGetting Started with Node.js
13mBuild your own Node js app in the browser with WebContainer API
48mTomorrow's ES modules today
32mPlease Wait... Loading: A Talk of Two Loaders
