eclipsesource / eclipsesource/J2V8

Use require & then create new instance of object & then call methods in realtime.

Open
#375 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.6k
Forks
387
PR merge metrics
No merged PRs in 30d

Description

Why I cannot do something simple like this?

`final NodeJS nodeJS = NodeJS.createNodeJS();
final V8Object ripple = nodeJS.require(new File("node_modules/ripple-lib")).getObject("RippleAPI");
V8Object api = ripple.newInstance();
api.executeJSFunction("generateAddress", null, callback);
`

Or how to transfer this to V8 NodeJS from Javascript?

`
const RippleAPI = require('ripple-lib').RippleAPI;
const api = new RippleAPI();
`

The catch is the new keyword and then be able to call its methods. I find it pretty basic, yet it does not work, therefore I find whole J2V8 initiative useless. If I would like to just capture simple function's output I could use something else or build REST API around Node.js thing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.