https://github.com/yunsii/node-jre-extra
Embed the Java Runtime Environment (JRE) into a Node.js app
https://github.com/yunsii/node-jre-extra
java jre node nodejs
Last synced: 8 months ago
JSON representation
Embed the Java Runtime Environment (JRE) into a Node.js app
- Host: GitHub
- URL: https://github.com/yunsii/node-jre-extra
- Owner: yunsii
- License: mit
- Created: 2023-07-08T14:51:32.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-23T07:25:02.000Z (about 2 years ago)
- Last Synced: 2024-12-30T11:45:12.111Z (10 months ago)
- Topics: java, jre, node, nodejs
- Language: TypeScript
- Homepage:
- Size: 12.7 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# node-jre-extra
[](https://www.npmjs.com/package/node-jre-extra)
This module will embed the Java Runtime Environment (JRE) into a Node.js app. It will download the platform specific JRE at installation time. Afterwards the embedding app can be bundled into a platform specific package. This package would not require any further JRE installation steps by users.
## Usage
After install the package, you can install JRE with specific version:
```shell
# Install JRE 8
$ npx node-jre-extra install# Install JRE with specific version, for example: 11
$ npx node-jre-extra install -v 11
```After installed, you can work with JRE for now:
```ts
import { getJavaBin } from 'node-jre-extra'
import { $ } from 'execa'const jarPath = 'hello.jar'
const javaBin = await getJavaBin()
const result = await $`${javaBin} -jar ${jarPath}`
console.log(result)
```## Build & Publish
- `npm run build`
- `npx changeset`
- `npx changeset version`
- `git commit`
- `npx changeset publish`
- `git push --follow-tags`> [`changeset` prerelease doc](https://github.com/changesets/changesets/blob/main/docs/prereleases.md)
## Credit
- [schreiben/node-jre](https://github.com/schreiben/node-jre/tree/master)
## License
[MIT](./LICENSE) License © 2022 [Yuns](https://github.com/yunsii)