Socket
Socket
Sign inDemoInstall

npm-java-runner

Package Overview
Dependencies
0
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    npm-java-runner

[![NPM](https://img.shields.io/npm/v/npm-java-runner.svg?style=flat-square)](https://www.npmjs.com/package/npm-java-runner)


Version published
Weekly downloads
4.8K
decreased by-12.73%
Maintainers
1
Install size
6.32 kB
Created
Weekly downloads
 

Readme

Source

NPM Java Runner

NPM

  • Include configured jar inside the NPM-package.
  • Provide a layer, delegating all arguments, so that the jar is runnable with npx.

So that you can create a command line tool with Java and distribute it as an NPM package.

Usage

Create an index.js with:

#!/usr/bin/env node
require('npm-java-runner/lib/index').run(__dirname);

Create package.json with:

{
  "name": "NAME",
  "runnable-jar-regexp": ".*build/libs/.*\\d+\\.\\d+\\.\\d+\\.jar",
  "files": ["build/libs"],
  "bin": "./index.js",
  "dependencies": {
    "npm-java-runner": "a.b.c"
  }
}

If you release this (npm publish), you will be able to run your jar with:

npx NAME --whatever arguments

Examples

Keywords

FAQs

Last updated on 01 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc