Skip to content

caoccao/Javet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

32ff273 · Jul 5, 2021

History

29 Commits
Jul 5, 2021
Jul 5, 2021
Apr 22, 2021
Jul 5, 2021
Jul 5, 2021
Feb 15, 2021
Feb 15, 2021
Jul 5, 2021
Jul 5, 2021
May 8, 2021
Feb 15, 2021
Feb 15, 2021
Jul 5, 2021
Feb 15, 2021

Repository files navigation

Javet

Maven Central Gitter Chatroom

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/.

Major Features

  • 🐧Linux + 🖥️Windows
  • Node.js v14.17.2 + V8 v9.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

Quick Start

Dependency

Maven

<dependency>
    <groupId>com.caoccao.javet</groupId>
    <artifactId>javet</artifactId>
    <version>0.9.3</version>
</dependency>

Gradle Kotlin DSL

implementation("com.caoccao.javet:javet:0.9.3")

Gradle Groovy DSL

implementation 'com.caoccao.javet:javet:0.9.3'

Hello Javet

// 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());
}

Documents

License

APACHE LICENSE, VERSION 2.0.