Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Modules load NPM? #1

Open
MTyson opened this issue Jul 19, 2016 · 3 comments
Open

Can Modules load NPM? #1

MTyson opened this issue Jul 19, 2016 · 3 comments

Comments

@MTyson
Copy link

MTyson commented Jul 19, 2016

I'm curious, can the Modules addition load NPM modules?

I read your blog on using NPM from Java, so I'm very interested to hear.

@Namek
Copy link
Owner

Namek commented Jul 19, 2016

Unfortunately, not. It's close to be able to load modules written purely in JavaScript (like left-pad). Anything that uses native functions/modules (i.e. those from NodeJS) like filesystem or sockets won't work here.

There were some projects I wrote about here https://www.namekdev.net/2016/04/the-state-of-importing-node-js-modules-into-java/ but at that time (3 months ago) there was nothing working with current version of NodeJS.

The require() function can be found here: https://github.com/Namek/TheConsole/blob/master/src/net/namekdev/theconsole/modules/require.js as you can see it has no connection with NodeJS, it's just a simulation.

@MTyson
Copy link
Author

MTyson commented Jul 21, 2016

I see what you are saying.

The area you are working on is very interested.

@MTyson
Copy link
Author

MTyson commented Jul 21, 2016

I looked through RingoJS also, and it looks like it gets to the point of supporting CommonJS as well, but stops at supporting nodejs calls inside Java.

It really looks like running full NodeJS in Java just doesn't exist yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants