Own requires? (fs, path, ...)
Meldiron opened this issue ยท 3 comments
Hello,
there are a lot of modules on NPM I can get and use in NodeJS.
If I try to run:
/js var fs = require('fs')
I get an error. Can I somehow install NPM modules?
SC is not a Node.js runtime. You don't get any of the modules in Node.js or NPM for ScriptCraft, because they're not compatible with it.
Some but not all modules are compatible. Basically there is no guarantee that any NPM module will work with scriptcraft if it relies on NodeJS subsystems (like fs, etc).
For example, underscore, lodash etc should work fine as they are UMD modules.