Coder Social home page Coder Social logo

caoccao / javet Goto Github PK

View Code? Open in Web Editor NEW
586.0 586.0 58.0 16.35 MB

Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding Node.js and V8 in Java.

Home Page: https://www.caoccao.com/Javet/

License: Apache License 2.0

CMake 0.60% Batchfile 0.04% Shell 0.16% C++ 14.11% C 0.07% JavaScript 0.55% Python 0.96% Java 82.09% TypeScript 0.01% Dockerfile 1.42%
android engine java java-v8 javascript javet linux macos nodejs v8 v8-javascript-engine windows

javet's Introduction

Javet

Maven Central Discord Donate

Linux x86_64 Build MacOS x86_64 Build MacOS arm64 Build Android Node Build Android V8 Build

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 https://blog.caoccao.com/ or https://caoccao.blogspot.com/. And the official support channel is at discord.

๐Ÿ’– If you like my work, please donate to support me. If you have a retired Mac OS (x86_64) device and are fine with mailing it to me, that will be great because I don't have such device to support the community. Thank you for supporting Javet.

Major Features

CPU Arch Android Linux MacOS Windows
x86 โœ”๏ธ

โŒ

โŒ

โŒ

x86_64 โœ”๏ธ

โœ”๏ธ

โœ”๏ธ

โœ”๏ธ

arm โœ”๏ธ

โŒ

โŒ

โŒ

arm64 โœ”๏ธ

โœ”๏ธ

โœ”๏ธ

โŒ

  • Node.js v20.12.2 + V8 v12.4.254.9
  • Dynamic switch between Node.js and V8 mode (Which mode do you prefer?)
  • Polyfill V8 mode with Javenode
  • V8 API exposure in JVM
  • JavaScript and Java interop
  • Native BigInt and Date
  • Javet engine pool
  • Easy spring integration
  • Live debug with Chrome DevTools
  • AST analysis with JavetSanitizer
  • TS, JSX, TSX transpilation with swc4j
  • Live interaction with JavetShell

Quick Start

Dependency

Maven

<!-- Linux and Windows (x86_64) -->
<dependency>
    <groupId>com.caoccao.javet</groupId>
    <artifactId>javet</artifactId>
    <version>3.1.1</version>
</dependency>

<!-- Linux (arm64) -->
<dependency>
    <groupId>com.caoccao.javet</groupId>
    <artifactId>javet-linux-arm64</artifactId>
    <version>3.1.1</version>
</dependency>

<!-- Mac OS (x86_64 and arm64) -->
<dependency>
    <groupId>com.caoccao.javet</groupId>
    <artifactId>javet-macos</artifactId>
    <version>3.1.1</version>
</dependency>

Gradle Kotlin DSL

implementation("com.caoccao.javet:javet:3.1.1") // Linux and Windows (x86_64)
implementation("com.caoccao.javet:javet-linux-arm64:3.1.1") // Linux (arm64)
implementation("com.caoccao.javet:javet-macos:3.1.1") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet-android-node:3.1.1") // Android Node (arm, arm64, x86 and x86_64)
implementation("com.caoccao.javet:javet-android-v8:3.1.1") // Android V8 (arm, arm64, x86 and x86_64)

Gradle Groovy DSL

implementation 'com.caoccao.javet:javet:3.1.1' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-linux-arm64:3.1.1' // Linux (arm64)
implementation 'com.caoccao.javet:javet-macos:3.1.1' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-android-node:3.1.1' // Android Node (arm, arm64, x86 and x86_64)
implementation 'com.caoccao.javet:javet-android-v8:3.1.1' // Android V8 (arm, arm64, x86 and x86_64)

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

Sponsors

HiveMQ

License

APACHE LICENSE, VERSION 2.0

Blog

Documents

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.