Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding Node.js and V8 in Java.
If you like my work, please Star this project. And, you may follow me @sjtucaocao, or visit http://caoccao.blogspot.com/.
- 🐧Linux + 🖥️Windows
- Node.js
v14.17.2
+ V8v9.1.269.28
- Dynamic switch between Node.js and V8
- Exposure of the majority of V8 API in JVM
- JS function interception
- Native BigInt and Date
- Javet engine pool
- Easy spring integration
- Live debug with Chrome DevTools
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet</artifactId>
<version>0.9.3</version>
</dependency>
implementation("com.caoccao.javet:javet:0.9.3")
implementation 'com.caoccao.javet:javet:0.9.3'
// Node.js Mode
try (V8Runtime v8Runtime = V8Host.getNodeInstance().createV8Runtime()) {
System.out.println(v8Runtime.getExecutor("'Hello Javet'").executeString());
}
// V8 Mode
try (V8Runtime v8Runtime = V8Host.getV8Instance().createV8Runtime()) {
System.out.println(v8Runtime.getExecutor("'Hello Javet'").executeString());
}