简体   繁体   中英

Add node js project as a dependency in a java project

I need to be able to add an existing Node js project as a maven dependency in a java project to be able to call functions from the node js project. I researched quiet a bit but am unable to find a way to do this. I do not want to embed js in java, rather just import the libraries. Can anybody suggest a way ?

You could create a new Kotlin mutlti-platform project which takes a dependency on your node-js package. Then you could create a wrapper kotlin function which calls your node-js function. You can then use this Kotlin package as a dependency in your Java package. Here is more information regarding Kotlin multi-platform: https://kotlinlang.org/docs/multiplatform-library.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM