3 ms·
Introduction to Isolated-VM in Node.js
- ryohkyo 5y agoMy question may sound silly here. What’s the advantage of an isolated-vm over async function with graceful error handling/time out?
- NhanH 5y agoIsolated-vm was originally developed for the game screeps. It’s a programming game where each player’s code is ran on the server, so isolated-vm helps with both runtime issue (one player’s code crashing not affecting everyone else on the same node) as well as adding some security benefits.
- ryohkyo 5y agoThank you NhanH, it makes sense now.
- fathyb 5y agoI've been using isolated-vm for refloat.io, but ended up switching to the native Node.js vm API after having issues getting its native module to run with vercel/pkg. One big difference is isolated-vm allows creating a separate v8 Isolate, separating the memory heaps, making it safer to run untrusted code. I don't think we can do that with the native Node.js API yet.