ScriptCraft

ScriptCraft

14.6k Downloads

Own requires? (fs, path, ...)

Meldiron opened this issue ยท 3 comments

commented

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?

commented

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.

commented

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.

commented

Whats the correct way to use files in this plugin? (for example settings file - settings.json)