New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

npm-java-runner

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-java-runner - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

44

lib/index.js
#!/usr/bin/env node
"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -10,36 +17,9 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

var fs_1 = __importDefault(require("fs"));
var shelljs_1 = require("shelljs");
var spawn = require('child_process').spawn;
function executeJar(jarFile) {
var userArgs = process.argv.slice(2);
var javaArgs = [];
var programArgs = [];
userArgs.forEach(function (arg) {
if (arg.startsWith('-D') || arg.startsWith('-X') || arg.startsWith('-P')) {
javaArgs.push(arg);
}
else {
programArgs.push(arg);
}
});
var cmd = 'java';
javaArgs.forEach(function (arg) {
cmd += " " + arg;
});
cmd += " -jar " + jarFile + " ";
programArgs.forEach(function (arg) {
cmd += " " + arg;
});
var child = shelljs_1.exec(cmd, { async: true });
process.stdin.setEncoding('utf8');
process.stdin.on('readable', function () {
var chunk = process.stdin.read();
if (chunk === null) {
return;
}
try {
child.stdin.write(chunk);
}
catch (e) { }
});
child.on('close', function (code) {
var command = spawn('java', __spreadArrays(['-jar', jarFile], userArgs));
command.stdout.pipe(process.stdout);
command.stderr.pipe(process.stderr);
command.on('close', function (code) {
process.exit(code);

@@ -46,0 +26,0 @@ });

{
"name": "npm-java-runner",
"version": "0.0.14",
"version": "0.0.15",
"scripts": {

@@ -10,5 +10,3 @@ "build": "npm run format && tsc -p .",

"dependencies": {
"@types/shelljs": "^0.8.9",
"path": "^0.12.7",
"shelljs": "^0.8.4"
"path": "^0.12.7"
},

@@ -15,0 +13,0 @@ "devDependencies": {

@@ -10,6 +10,2 @@ # NPM Java Runner

Example:
- [Git Changelog Command Line](https://github.com/tomasbjerre/git-changelog-command-line)
## Usage

@@ -16,0 +12,0 @@

Sorry, the diff of this file is not supported yet

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