malaporte / nashorn-commonjs-modules

CommonJS modules support for Nashorn
MIT License
108 stars 31 forks source link

loading built-in node modules #32

Closed tracyhenry closed 6 years ago

tracyhenry commented 6 years ago

I have succeeded in loading some modules through the file system. However, I'm having trouble loading built-in node modules such as http or url and any modules that require these. The reason is probably because the root folder I specified does not have these modules under it.

How should I get around this?

malaporte commented 6 years ago

This package isn't a Node JS emulator, as it doesn't provide an implementation for the (many) core NodeJS modules. You can only use it to load JS packages that don't rely on those (ex: packages that are designed to work in a web page, etc.)