Javet — An awesome way of embedding Node.js and V8 in Java.

Major Features

  • 🐧Linux + 🖥️Windows
  • Node.js v14.16.1 + V8 v9.0.257
  • 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.8.7</version>
</dependency>

Gradle Kotlin DSL

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

Gradle Groovy DSL

implementation 'com.caoccao.javet:javet:0.8.7'

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

--

--

--

Amateur programmer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

IIFF in JavaScript

//platform.twitter.com/widgets.js from Twitter https://twitter.com/thehikeexperts

Redux — Working with Multiple Reducers

Why Objects are copied & compared by reference?

Docker Fundas ( My Version 😜 )

Laraval Queues dependency injection

Integromat’s New Devtool: Complex Scenarios Made Easy

How To Create a Discord Bot With 10 Lines of JavaScript Code

Coding setup

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sam Cao

Sam Cao

Amateur programmer

More from Medium

Integrate a Spring API with AWS S3 to send files and then consume them with a React and Angular app

Implementation of stack using array in C — SS Blog

Implementation of stack using array in C — SS Blog

From Imperative to Reactive Web API

[React] Unit Testing APIs with Mock Service Worker (MSW)