You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use some NPM modules in my code. I want to use webjars as the source of those modules, so that users of the software do not need to have npm installed.
Is it possible to refer to modules on the classpath in some way for nodejs.require()?
The text was updated successfully, but these errors were encountered:
Yes - I was able to do this. I needed to redefine fs.readFile* an fs.exists*. That almost did it, but node.js's module.js loader doesn't actually use fs.exists* for performance reasons. I couldn't redefine the native stat() function it used, so I had to go one layer up. I redefined module._findPath, which needed to bring with it a pretty significant portion of the module loader code unfortunately.
And it works! Needless to say, this is highly implementation dependent. As node changes, this could/will break.
A nice feature request would be have J2V8 expose all file operations (native and not) as java callbacks.
Unfortunately I need to reduce the scope of this project. I haven't been maintaining NodeJS support with J2V8 for a while now, and I think it's better to be honest about that then to just leave these bugs here. Please see #441 for more information.
If someone would like to create a downstream project that provides the Node bindings, I would support that and be happy to help them get started. I'm Labeling the NodeJS related bugs so we can move them to a downstream project if someone does setup such a project.
Again, sorry for the disappointment, but I think it's better to set honest expectations.
I'm trying to use some NPM modules in my code. I want to use webjars as the source of those modules, so that users of the software do not need to have
npm
installed.Is it possible to refer to modules on the classpath in some way for
nodejs.require()
?The text was updated successfully, but these errors were encountered: