Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

java-caller

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

java-caller - npm Package Compare versions

Comparing version 3.2.1-beta202311260852.0 to 3.3.1-beta202401282315.0

10

lib/java-caller.js

@@ -27,2 +27,3 @@ #! /usr/bin/env node

javaExecutable = "java";
javaExecutableWindowless = "javaw";
additionalJavaArgs = [];

@@ -84,9 +85,10 @@ commandJavaArgs = [];

runOptions.windowsVerbatimArguments = typeof runOptions.windowsVerbatimArguments === "undefined" ? true : runOptions.windowsVerbatimArguments;
runOptions.windowless = typeof runOptions.windowless === "undefined" ? false : os.platform() !== "win32" ? false : runOptions.windowless;
this.commandJavaArgs = (runOptions.javaArgs || []).concat(this.additionalJavaArgs);
let javaExe = this.javaExecutable;
let javaExe = runOptions.windowless ? this.javaExecutableWindowless : this.javaExecutable;
if (javaExe.toLowerCase().includes(".exe") && !javaExe.includes(`'`)) {
// Java executable has been overridden by caller : use it
javaExe = `"${path.resolve(javaExe)}"`;
} else if (javaExe === "java") {
} else if (javaExe === "java" || javaExe === "javaw") {
// Check if matching java version is present, install and update PATH if it is not

@@ -107,3 +109,3 @@ await this.manageJavaInstall();

detached: runOptions.detached,
cwd: javaExe === "java" ? runOptions.cwd : undefined,
cwd: javaExe === "java" || javaExe === "javaw" ? runOptions.cwd : undefined,
env: Object.assign({}, process.env),

@@ -432,2 +434,2 @@ stdio: this.output === "console" ? "inherit" : runOptions.detached ? "ignore" : "pipe",

module.exports = { JavaCaller };
module.exports = { JavaCaller };

2

package.json
{
"name": "java-caller",
"version": "3.2.1-beta202311260852.0",
"version": "3.3.1-beta202401282315.0",
"description": "Library to easily call java from node sources. Automatically installs java if not present",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -6,3 +6,4 @@ <!-- markdownlint-disable MD033 -->

[![Downloads/week](https://img.shields.io/npm/dw/java-caller.svg)](https://npmjs.org/package/java-caller)
[![Downloads/total](https://img.shields.io/npm/dt/java-caller.svg)](https://npmjs.org/package/java-caller)
[![Downloads/total](https://img.shields.io/npm/dt/java-caller.svg)](https://npmjs.org/package/java-caller)<!-- gh-dependents-info-used-by-start -->
[![Generated by github-dependents-info](https://img.shields.io/static/v1?label=Used%20by&message=99&color=informational&logo=slickpic)](https://github.com/nvuillam/node-java-caller/blob/main/docs/github-dependents-info.md)<!-- gh-dependents-info-used-by-end -->
[![CircleCI](https://circleci.com/gh/nvuillam/node-java-caller/tree/master.svg?style=shield)](https://circleci.com/gh/nvuillam/node-java-caller/tree/master)

@@ -75,2 +76,3 @@ [![Mega-Linter](https://github.com/nvuillam/node-java-caller/workflows/Mega-Linter/badge.svg)](https://github.com/nvuillam/mega-linter#readme)

| [windowsVerbatimArguments](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) | No quoting or escaping of arguments is done on Windows. Ignored on Unix. This is set to true automatically when shell is specified and is CMD. | `true` | `false` |
| [windowless](https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#:~:text=main()%20method.-,javaw,information%20if%20a%20launch%20fails.) | If windowless is true, JavaCaller calls javaw instead of java to not create any windows, useful when using detached on Windows. Ignored on Unix. | false | true

@@ -141,2 +143,12 @@ ## Examples

Call a windowless java process
```javascript
const java = new JavaCaller({
classPath: 'test/java/dist',
mainClass: 'com.nvuillam.javacaller.JavaCallerTester'
});
const { status, stdout, stderr } = await java.run(['--sleep'], { windowless: true });
```
You can see **more examples in** [**test methods**](https://github.com/nvuillam/node-java-caller/blob/master/test/java-caller.test.js)

@@ -143,0 +155,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc