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

java-bridge

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

java-bridge - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

2

dist/index.prod.min.js

@@ -1,2 +0,2 @@

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.java=r():e.java=r()}(global,(()=>(()=>{var e={388:(e,r,a)=>{e=a.nmd(e);try{process.dlopen(e,__dirname+a(17).sep+a.p+"java.linux-x64-gnu.node")}catch(e){throw new Error("node-loader:\n"+e)}},163:(e,r,a)=>{const{existsSync:n,readFileSync:t}=a(147),{join:o}=a(17),{platform:i,arch:c}=process;let s=null,u=!1,d=null;function l(){if(process.report&&"function"==typeof process.report.getReport){const{glibcVersionRuntime:e}=process.report.getReport().header;return!e}try{const e=a(81).execSync("which ldd").toString().trim();return t(e,"utf8").includes("musl")}catch(e){return!0}}switch(i){case"android":switch(c){case"arm64":u=n(o(__dirname,"java.android-arm64.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.android-arm64.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-android-arm64")}catch(e){d=e}break;case"arm":u=n(o(__dirname,"java.android-arm-eabi.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.android-arm-eabi.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-android-arm-eabi")}catch(e){d=e}break;default:throw new Error(`Unsupported architecture on Android ${c}`)}break;case"win32":switch(c){case"x64":u=n(o(__dirname,"java.win32-x64-msvc.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.win32-x64-msvc.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-win32-x64-msvc")}catch(e){d=e}break;case"ia32":u=n(o(__dirname,"java.win32-ia32-msvc.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.win32-ia32-msvc.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-win32-ia32-msvc")}catch(e){d=e}break;case"arm64":u=n(o(__dirname,"java.win32-arm64-msvc.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.win32-arm64-msvc.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-win32-arm64-msvc")}catch(e){d=e}break;default:throw new Error(`Unsupported architecture on Windows: ${c}`)}break;case"darwin":u=n(o(__dirname,"java.darwin-universal.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.darwin-universal.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-darwin-universal");break}catch{}switch(c){case"x64":u=n(o(__dirname,"java.darwin-x64.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.darwin-x64.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-darwin-x64")}catch(e){d=e}break;case"arm64":u=n(o(__dirname,"java.darwin-arm64.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.darwin-arm64.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-darwin-arm64")}catch(e){d=e}break;default:throw new Error(`Unsupported architecture on macOS: ${c}`)}break;case"freebsd":if("x64"!==c)throw new Error(`Unsupported architecture on FreeBSD: ${c}`);u=n(o(__dirname,"java.freebsd-x64.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.freebsd-x64.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-freebsd-x64")}catch(e){d=e}break;case"linux":switch(c){case"x64":if(l()){u=n(o(__dirname,"java.linux-x64-musl.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-x64-musl.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-x64-musl")}catch(e){d=e}}else{u=n(o(__dirname,"java.linux-x64-gnu.node"));try{s=u?a(388):require("java-bridge-linux-x64-gnu")}catch(e){d=e}}break;case"arm64":if(l()){u=n(o(__dirname,"java.linux-arm64-musl.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-arm64-musl.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-arm64-musl")}catch(e){d=e}}else{u=n(o(__dirname,"java.linux-arm64-gnu.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-arm64-gnu.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-arm64-gnu")}catch(e){d=e}}break;case"arm":u=n(o(__dirname,"java.linux-arm-gnueabihf.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-arm-gnueabihf.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-arm-gnueabihf")}catch(e){d=e}break;default:throw new Error(`Unsupported architecture on Linux: ${c}`)}break;default:throw new Error(`Unsupported OS: ${i}, architecture: ${c}`)}if(!s){if(d)throw d;throw new Error("Failed to load native binding")}const{JavaInterfaceProxy:f,clearDaemonProxies:v,Java:p,clearClassProxies:b,JavaConfig:m,StdoutRedirect:j,getJavaLibPath:g,logging:h}=s;e.exports.JavaInterfaceProxy=f,e.exports.clearDaemonProxies=v,e.exports.Java=p,e.exports.clearClassProxies=b,e.exports.JavaConfig=m,e.exports.StdoutRedirect=j,e.exports.getJavaLibPath=g,e.exports.logging=h},91:(e,r,a)=>{"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),r.JavaObject=r.JavaVersion=void 0,a(837),function(e){e.VER_1_1="1.1",e.VER_1_2="1.2",e.VER_1_4="1.4",e.VER_1_6="1.6",e.VER_1_8="1.8",e.VER_9="9",e.VER_10="10"}(n||(r.JavaVersion=n={})),Object.freeze(n),r.JavaObject=class{}},236:function(e,r,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,r,a,n){void 0===n&&(n=a);var t=Object.getOwnPropertyDescriptor(r,a);t&&!("get"in t?!r.__esModule:t.writable||t.configurable)||(t={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(e,n,t)}:function(e,r,a,n){void 0===n&&(n=a),e[n]=r[a]}),t=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),o=this&&this.__exportStar||function(e,r){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(r,a)||n(r,e,a)},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(r,e,a);return t(r,e),r};Object.defineProperty(r,"__esModule",{value:!0}),r.getJavaVersionSync=r.getJavaVersion=r.getJavaLibPath=r.UnknownJavaClass=r.JavaClassConstructor=r.JavaClass=r.JavaClassProxy=r.JavaClassInstance=r.JavaObject=r.JavaVersion=void 0;var c=a(91);Object.defineProperty(r,"JavaVersion",{enumerable:!0,get:function(){return c.JavaVersion}}),Object.defineProperty(r,"JavaObject",{enumerable:!0,get:function(){return c.JavaObject}}),Object.defineProperty(r,"JavaClassInstance",{enumerable:!0,get:function(){return c.JavaClassInstance}}),Object.defineProperty(r,"JavaClassProxy",{enumerable:!0,get:function(){return c.JavaClassProxy}}),Object.defineProperty(r,"JavaClass",{enumerable:!0,get:function(){return c.JavaClass}}),Object.defineProperty(r,"JavaClassConstructor",{enumerable:!0,get:function(){return c.JavaClassConstructor}}),Object.defineProperty(r,"UnknownJavaClass",{enumerable:!0,get:function(){return c.UnknownJavaClass}}),o(a(818),r);const s=i(a(818));r.default=s;var u=a(163);Object.defineProperty(r,"getJavaLibPath",{enumerable:!0,get:function(){return u.getJavaLibPath}});var d=a(102);Object.defineProperty(r,"getJavaVersion",{enumerable:!0,get:function(){return d.getJavaVersion}}),Object.defineProperty(r,"getJavaVersionSync",{enumerable:!0,get:function(){return d.getJavaVersionSync}})},818:(e,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.config=r.getJavaInstance=r.newProxy=r.stdout=r.classpath=r.isInstanceOf=r.appendClasspath=r.importClassAsync=r.importClass=r.setClassLoader=r.getClassLoader=r.ensureJvm=r.logging=r.clearClassProxies=r.clearDaemonProxies=void 0;const n=a(163),t=a(841);var o=a(163);Object.defineProperty(r,"clearDaemonProxies",{enumerable:!0,get:function(){return o.clearDaemonProxies}}),Object.defineProperty(r,"clearClassProxies",{enumerable:!0,get:function(){return o.clearClassProxies}}),Object.defineProperty(r,"logging",{enumerable:!0,get:function(){return o.logging}});let i=null;function c(e){return!i&&(i=new n.Java(e?.libPath,e?.version,e?.opts,e,(0,t.getJavaLibPath)(e?.isPackagedElectron??!1),(0,t.getNativeLibPath)(e?.isPackagedElectron??!1)),!0)}function s(e){c(),i.appendClasspath(e)}var u,d;r.ensureJvm=c,r.getClassLoader=function(){return c(),i.classLoader},r.setClassLoader=function(e){c(),i.classLoader=e},r.importClass=function(e,r){return c(),i.importClass(e,r)},r.importClassAsync=function(e,r){return c(),i.importClassAsync(e,r)},r.appendClasspath=s,r.isInstanceOf=function(e,r){return c(),i.isInstanceOf(e,r)},function(e){e.append=function(e){s(e)},e.get=function(){return c(),i.loadedJars}}(u||(r.classpath=u={})),(d||(r.stdout=d={})).enableRedirect=function(e,r){return c(),i.setStdoutCallbacks(e,r)},r.newProxy=function(e,r,a){c();const n=Object.create(null);for(const[e,a]of Object.entries(r))n[e]=(e,r,...n)=>{if(e)throw e;try{const e=a(...n);e instanceof Promise?e.then((e=>r(null,e)),(e=>{e instanceof Error?r(e):r(new Error(String(e)))})):r(null,e)}catch(e){e instanceof Error?r(e):r(new Error(String(e)))}};return i.createInterfaceProxy(e,n,a)},r.getJavaInstance=function(){return i},r.config=new n.JavaConfig},841:function(e,r,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,r,a,n){void 0===n&&(n=a);var t=Object.getOwnPropertyDescriptor(r,a);t&&!("get"in t?!r.__esModule:t.writable||t.configurable)||(t={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(e,n,t)}:function(e,r,a,n){void 0===n&&(n=a),e[n]=r[a]}),t=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(r,e,a);return t(r,e),r},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.getJavaLibPath=r.getNativeLibPath=void 0;const c=i(a(17)),s=o(a(147)),u=a(230),{platform:d,arch:l}=process,f=/([\\/])app\.asar([\\/])/gim,v="$1app.asar.unpacked$2";function p(e,r){const n=c.default.join(__dirname,e+".node");if(s.default.existsSync(n))return r&&console.warn("Using local native module in packaged Electron app"),n;{const n=e.replaceAll(".","-").replace("java","java-bridge");let t;return t=require&&require.resolve?require.resolve(n):a(955).resolve(n),r&&(t=t.replace(f,v)),t}}function b(){return new Error(`Unsupported platform: ${d} ${l}`)}r.getNativeLibPath=function(e){switch(d){case"android":switch(l){case"arm64":return p("java.android-arm64",e);case"arm":return p("java.android-arm-eabi",e);default:throw b()}case"win32":return p(`java.win32-${l}-msvc`,e);case"darwin":return p(`java.darwin-${l}`,e);case"freebsd":return p(`java.freebsd-${l}`,e);case"linux":switch(l){case"x64":case"arm64":return p(`java.linux-${l}-${function(){if(process.report&&"function"==typeof process.report.getReport){const{glibcVersionRuntime:e}=process.report.getReport().header;return!e}try{return(0,s.readFileSync)("/usr/bin/ldd","utf8").includes("musl")}catch(e){return!0}}()?"musl":"gnu"}`,e);case"arm":return p("java.linux-arm-gnueabihf",e);default:throw b()}default:throw b()}},r.getJavaLibPath=function(e){let r=c.default.join(__dirname,"..","java-src","build","libs");e&&(r=r.replace(f,v));const a=(0,u.globSync)("*.jar",{cwd:r});if(0===a.length)throw new Error(`No java lib found in ${r}`);return c.default.join(r,a[0])}},102:(e,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getJavaVersionSync=r.getJavaVersion=void 0;const n=a(818);r.getJavaVersion=async function(){const e=await(0,n.importClassAsync)("java.lang.System");return await e.getProperty("java.version")},r.getJavaVersionSync=function(){return(0,n.importClass)("java.lang.System").getPropertySync("java.version")}},955:e=>{function r(e){var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}r.keys=()=>[],r.resolve=r,r.id=955,e.exports=r},230:e=>{"use strict";e.exports=require("glob")},81:e=>{"use strict";e.exports=require("child_process")},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")},837:e=>{"use strict";e.exports=require("util")}},r={};function a(n){var t=r[n];if(void 0!==t)return t.exports;var o=r[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}return a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="",a(236)})()));
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.java=r():e.java=r()}(global,(()=>(()=>{var e={309:(e,r,a)=>{e=a.nmd(e);try{process.dlopen(e,__dirname+a(928).sep+a.p+"java.linux-x64-gnu.node")}catch(e){throw new Error("node-loader:\n"+e)}},147:(e,r,a)=>{const{existsSync:n,readFileSync:t}=a(896),{join:o}=a(928),{platform:i,arch:c}=process;let s=null,u=!1,d=null;function l(){if(process.report&&"function"==typeof process.report.getReport){const{glibcVersionRuntime:e}=process.report.getReport().header;return!e}try{const e=a(317).execSync("which ldd").toString().trim();return t(e,"utf8").includes("musl")}catch(e){return!0}}switch(i){case"android":switch(c){case"arm64":u=n(o(__dirname,"java.android-arm64.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.android-arm64.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-android-arm64")}catch(e){d=e}break;case"arm":u=n(o(__dirname,"java.android-arm-eabi.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.android-arm-eabi.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-android-arm-eabi")}catch(e){d=e}break;default:throw new Error(`Unsupported architecture on Android ${c}`)}break;case"win32":switch(c){case"x64":u=n(o(__dirname,"java.win32-x64-msvc.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.win32-x64-msvc.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-win32-x64-msvc")}catch(e){d=e}break;case"ia32":u=n(o(__dirname,"java.win32-ia32-msvc.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.win32-ia32-msvc.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-win32-ia32-msvc")}catch(e){d=e}break;case"arm64":u=n(o(__dirname,"java.win32-arm64-msvc.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.win32-arm64-msvc.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-win32-arm64-msvc")}catch(e){d=e}break;default:throw new Error(`Unsupported architecture on Windows: ${c}`)}break;case"darwin":u=n(o(__dirname,"java.darwin-universal.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.darwin-universal.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-darwin-universal");break}catch{}switch(c){case"x64":u=n(o(__dirname,"java.darwin-x64.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.darwin-x64.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-darwin-x64")}catch(e){d=e}break;case"arm64":u=n(o(__dirname,"java.darwin-arm64.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.darwin-arm64.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-darwin-arm64")}catch(e){d=e}break;default:throw new Error(`Unsupported architecture on macOS: ${c}`)}break;case"freebsd":if("x64"!==c)throw new Error(`Unsupported architecture on FreeBSD: ${c}`);u=n(o(__dirname,"java.freebsd-x64.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.freebsd-x64.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-freebsd-x64")}catch(e){d=e}break;case"linux":switch(c){case"x64":if(l()){u=n(o(__dirname,"java.linux-x64-musl.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-x64-musl.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-x64-musl")}catch(e){d=e}}else{u=n(o(__dirname,"java.linux-x64-gnu.node"));try{s=u?a(309):require("java-bridge-linux-x64-gnu")}catch(e){d=e}}break;case"arm64":if(l()){u=n(o(__dirname,"java.linux-arm64-musl.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-arm64-musl.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-arm64-musl")}catch(e){d=e}}else{u=n(o(__dirname,"java.linux-arm64-gnu.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-arm64-gnu.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-arm64-gnu")}catch(e){d=e}}break;case"arm":u=n(o(__dirname,"java.linux-arm-gnueabihf.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-arm-gnueabihf.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-arm-gnueabihf")}catch(e){d=e}break;case"riscv64":if(l()){u=n(o(__dirname,"java.linux-riscv64-musl.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-riscv64-musl.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-riscv64-musl")}catch(e){d=e}}else{u=n(o(__dirname,"java.linux-riscv64-gnu.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-riscv64-gnu.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-riscv64-gnu")}catch(e){d=e}}break;case"s390x":u=n(o(__dirname,"java.linux-s390x-gnu.node"));try{s=u?a(Object(function(){var e=new Error("Cannot find module './java.linux-s390x-gnu.node'");throw e.code="MODULE_NOT_FOUND",e}())):require("java-bridge-linux-s390x-gnu")}catch(e){d=e}break;default:throw new Error(`Unsupported architecture on Linux: ${c}`)}break;default:throw new Error(`Unsupported OS: ${i}, architecture: ${c}`)}if(!s){if(d)throw d;throw new Error("Failed to load native binding")}const{JavaInterfaceProxy:v,clearDaemonProxies:f,Java:b,clearClassProxies:p,JavaConfig:m,StdoutRedirect:j,getJavaLibPath:g,logging:_}=s;e.exports.JavaInterfaceProxy=v,e.exports.clearDaemonProxies=f,e.exports.Java=b,e.exports.clearClassProxies=p,e.exports.JavaConfig=m,e.exports.StdoutRedirect=j,e.exports.getJavaLibPath=g,e.exports.logging=_},514:(e,r,a)=>{"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),r.JavaObject=r.JavaVersion=void 0,a(23),function(e){e.VER_1_1="1.1",e.VER_1_2="1.2",e.VER_1_4="1.4",e.VER_1_6="1.6",e.VER_1_8="1.8",e.VER_9="9",e.VER_10="10"}(n||(r.JavaVersion=n={})),Object.freeze(n),r.JavaObject=class{}},772:function(e,r,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,r,a,n){void 0===n&&(n=a);var t=Object.getOwnPropertyDescriptor(r,a);t&&!("get"in t?!r.__esModule:t.writable||t.configurable)||(t={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(e,n,t)}:function(e,r,a,n){void 0===n&&(n=a),e[n]=r[a]}),t=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),o=this&&this.__exportStar||function(e,r){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(r,a)||n(r,e,a)},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(r,e,a);return t(r,e),r};Object.defineProperty(r,"__esModule",{value:!0}),r.getJavaVersionSync=r.getJavaVersion=r.getJavaLibPath=r.UnknownJavaClass=r.JavaClassConstructor=r.JavaClass=r.JavaClassProxy=r.JavaClassInstance=r.JavaObject=r.JavaVersion=void 0;var c=a(514);Object.defineProperty(r,"JavaVersion",{enumerable:!0,get:function(){return c.JavaVersion}}),Object.defineProperty(r,"JavaObject",{enumerable:!0,get:function(){return c.JavaObject}}),Object.defineProperty(r,"JavaClassInstance",{enumerable:!0,get:function(){return c.JavaClassInstance}}),Object.defineProperty(r,"JavaClassProxy",{enumerable:!0,get:function(){return c.JavaClassProxy}}),Object.defineProperty(r,"JavaClass",{enumerable:!0,get:function(){return c.JavaClass}}),Object.defineProperty(r,"JavaClassConstructor",{enumerable:!0,get:function(){return c.JavaClassConstructor}}),Object.defineProperty(r,"UnknownJavaClass",{enumerable:!0,get:function(){return c.UnknownJavaClass}}),o(a(230),r);const s=i(a(230));r.default=s;var u=a(147);Object.defineProperty(r,"getJavaLibPath",{enumerable:!0,get:function(){return u.getJavaLibPath}});var d=a(242);Object.defineProperty(r,"getJavaVersion",{enumerable:!0,get:function(){return d.getJavaVersion}}),Object.defineProperty(r,"getJavaVersionSync",{enumerable:!0,get:function(){return d.getJavaVersionSync}})},230:(e,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.config=r.getJavaInstance=r.newProxy=r.stdout=r.classpath=r.isInstanceOf=r.appendClasspath=r.importClassAsync=r.importClass=r.setClassLoader=r.getClassLoader=r.ensureJvm=r.logging=r.clearClassProxies=r.clearDaemonProxies=void 0;const n=a(147),t=a(74);var o=a(147);Object.defineProperty(r,"clearDaemonProxies",{enumerable:!0,get:function(){return o.clearDaemonProxies}}),Object.defineProperty(r,"clearClassProxies",{enumerable:!0,get:function(){return o.clearClassProxies}}),Object.defineProperty(r,"logging",{enumerable:!0,get:function(){return o.logging}});let i=null;function c(e){return!i&&(i=new n.Java(e?.libPath,e?.version,e?.opts,e,(0,t.getJavaLibPath)(),(0,t.getNativeLibPath)(e?.isPackagedElectron??!1)),!0)}function s(e){c(),i.appendClasspath(e)}var u,d;r.ensureJvm=c,r.getClassLoader=function(){return c(),i.classLoader},r.setClassLoader=function(e){c(),i.classLoader=e},r.importClass=function(e,r){return c(),i.importClass(e,r)},r.importClassAsync=function(e,r){return c(),i.importClassAsync(e,r)},r.appendClasspath=s,r.isInstanceOf=function(e,r){return c(),i.isInstanceOf(e,r)},function(e){e.append=function(e){s(e)},e.get=function(){return c(),i.loadedJars}}(u||(r.classpath=u={})),(d||(r.stdout=d={})).enableRedirect=function(e,r){return c(),i.setStdoutCallbacks(e,r)},r.newProxy=function(e,r,a){c();const n=Object.create(null);for(const[e,a]of Object.entries(r))n[e]=(e,r,...n)=>{if(e)throw e;try{const e=a(...n);e instanceof Promise?e.then((e=>r(null,e)),(e=>{e instanceof Error?r(e):r(new Error(String(e)))})):r(null,e)}catch(e){e instanceof Error?r(e):r(new Error(String(e)))}};return i.createInterfaceProxy(e,n,a)},r.getJavaInstance=function(){return i},r.config=new n.JavaConfig},74:function(e,r,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,r,a,n){void 0===n&&(n=a);var t=Object.getOwnPropertyDescriptor(r,a);t&&!("get"in t?!r.__esModule:t.writable||t.configurable)||(t={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(e,n,t)}:function(e,r,a,n){void 0===n&&(n=a),e[n]=r[a]}),t=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(r,e,a);return t(r,e),r},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.getJavaLibPath=r.getNativeLibPath=void 0;const c=i(a(928)),s=o(a(896)),{platform:u,arch:d}=process,l=/([\\/])app\.asar([\\/])/gim;function v(e,r){const n=c.default.join(__dirname,e+".node");if(s.default.existsSync(n))return r&&console.warn("Using local native module in packaged Electron app"),n;{const n=e.replaceAll(".","-").replace("java","java-bridge");let t;return t=require&&require.resolve?require.resolve(n):a(973).resolve(n),r&&(t=t.replace(l,"$1app.asar.unpacked$2")),t}}function f(){return new Error(`Unsupported platform: ${u} ${d}`)}r.getNativeLibPath=function(e){switch(u){case"android":switch(d){case"arm64":return v("java.android-arm64",e);case"arm":return v("java.android-arm-eabi",e);default:throw f()}case"win32":return v(`java.win32-${d}-msvc`,e);case"darwin":return v(`java.darwin-${d}`,e);case"freebsd":return v(`java.freebsd-${d}`,e);case"linux":switch(d){case"x64":case"arm64":return v(`java.linux-${d}-${function(){if(process.report&&"function"==typeof process.report.getReport){const{glibcVersionRuntime:e}=process.report.getReport().header;return!e}try{return(0,s.readFileSync)("/usr/bin/ldd","utf8").includes("musl")}catch(e){return!0}}()?"musl":"gnu"}`,e);case"arm":return v("java.linux-arm-gnueabihf",e);default:throw f()}default:throw f()}},r.getJavaLibPath=function(){const e=c.default.join(__dirname,"JavaBridge.jar");if(s.default.existsSync(e)&&s.default.statSync(e).isFile())return e;throw new Error("JavaBridge.jar not found")}},242:(e,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getJavaVersionSync=r.getJavaVersion=void 0;const n=a(230);r.getJavaVersion=async function(){const e=await(0,n.importClassAsync)("java.lang.System");return await e.getProperty("java.version")},r.getJavaVersionSync=function(){return(0,n.importClass)("java.lang.System").getPropertySync("java.version")}},973:e=>{function r(e){var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}r.keys=()=>[],r.resolve=r,r.id=973,e.exports=r},317:e=>{"use strict";e.exports=require("child_process")},896:e=>{"use strict";e.exports=require("fs")},928:e=>{"use strict";e.exports=require("path")},23:e=>{"use strict";e.exports=require("util")}},r={};function a(n){var t=r[n];if(void 0!==t)return t.exports;var o=r[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}return a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="",a(772)})()));
//# sourceMappingURL=index.prod.min.js.map

@@ -597,2 +597,5 @@ import { InterfaceProxyOptions, Java, JavaOptions, JavaConfig, ClassConfiguration } from '../native';

* * Call {@link JavaInterfaceProxy.reset} to instantly destroy this instance.
* Please note that calling {@link JavaInterfaceProxy.reset} is not necessary,
* the proxy instance will be automatically destroyed when it is garbage collected.
* Calling {@link JavaInterfaceProxy.reset} will just speed up the process.
* * If any method is queried by the java process and not implemented in here,

@@ -599,0 +602,0 @@ * an exception will be thrown in the java process.

export declare function getNativeLibPath(isPackagedElectron: boolean): string;
export declare function getJavaLibPath(isPackagedElectron: boolean): string;
export declare function getJavaLibPath(): string;
{
"name": "java-bridge",
"version": "2.4.0",
"version": "2.5.0",
"main": "dist/index.prod.min.js",

@@ -29,3 +29,4 @@ "types": "dist/index.d.ts",

"i686-pc-windows-msvc",
"aarch64-unknown-linux-gnu"
"aarch64-unknown-linux-gnu",
"x86_64-unknown-linux-musl"
]

@@ -49,7 +50,7 @@ }

"build": "npm run build:napi",
"build:debug": "npm run build:napi:debug && npm run build:ts && npm run build:java",
"postbuild": "npm run build:ts && npm run build:java",
"build:debug": "npm run build:napi:debug && npm run build:java && npm run build:ts",
"postbuild": "npm run build:java && npm run build:ts",
"build:napi": "napi build --cargo-name java --platform --release --js native.js --dts native.d.ts",
"build:napi:debug": "napi build --cargo-name java --platform --js native.js --dts native.d.ts",
"build:ts": "webpack build && cpy native.d.ts dist",
"build:ts": "webpack build",
"build:java": "run-script-os",

@@ -61,3 +62,3 @@ "build:java:darwin:linux": "cd java-src && chmod +x gradlew && ./gradlew shadowJar",

"testOnly": "npm run mocha",
"mocha": "mocha -r ts-node/register test/*.test.ts --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.json",
"mocha": "cross-env NODE_OPTIONS=\"--import tsx\" mocha test/*.test.ts --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.json",
"pretest": "npm run build",

@@ -69,9 +70,6 @@ "version": "napi version",

"prebuild:debug": "rimraf dist",
"benchmark": "ts-node -P test/tsconfig.json test/benchmark/benchmark.ts",
"benchmark": "tsx --tsconfig test/tsconfig.json test/benchmark/benchmark.ts",
"prebenchmark": "npm run build",
"docs": "typedoc --out docs ts-src/index.ts"
},
"dependencies": {
"glob": "^10.3.3"
},
"devDependencies": {

@@ -88,5 +86,7 @@ "@napi-rs/cli": "^2.16.2",

"@types/yargs": "^17.0.24",
"chai": "^4.3.7",
"chai": "^4.4.1",
"chai-as-promised": "^7.1.1",
"copy-webpack-plugin": "^12.0.2",
"cpy-cli": "^5.0.0",
"cross-env": "^7.0.3",
"expose-gc": "^1.0.0",

@@ -107,4 +107,5 @@ "is-ci": "^3.0.1",

"tslib": "^2.6.1",
"typedoc": "^0.24.8",
"typescript": "^5.1.6",
"tsx": "^4.7.1",
"typedoc": "^0.25.8",
"typescript": "^5.3.3",
"webpack": "^5.88.2",

@@ -115,9 +116,10 @@ "webpack-cli": "^5.1.4",

"optionalDependencies": {
"java-bridge-win32-x64-msvc": "2.4.0",
"java-bridge-darwin-x64": "2.4.0",
"java-bridge-linux-x64-gnu": "2.4.0",
"java-bridge-darwin-arm64": "2.4.0",
"java-bridge-win32-ia32-msvc": "2.4.0",
"java-bridge-linux-arm64-gnu": "2.4.0"
"java-bridge-win32-x64-msvc": "2.5.0",
"java-bridge-darwin-x64": "2.5.0",
"java-bridge-linux-x64-gnu": "2.5.0",
"java-bridge-darwin-arm64": "2.5.0",
"java-bridge-win32-ia32-msvc": "2.5.0",
"java-bridge-linux-arm64-gnu": "2.5.0",
"java-bridge-linux-x64-musl": "2.5.0"
}
}

@@ -5,4 +5,5 @@ # node-java

[![Check-style](https://github.com/MarkusJx/node-java-bridge/actions/workflows/check-style.yml/badge.svg)](https://github.com/MarkusJx/node-java-bridge/actions/workflows/check-style.yml)
[![SystemTest](https://github.com/MarkusJx/node-java-bridge/actions/workflows/system_test.yml/badge.svg)](https://github.com/MarkusJx/node-java-bridge/actions/workflows/system_test.yml)
<!--[![SystemTest](https://github.com/MarkusJx/node-java-bridge/actions/workflows/system_test.yml/badge.svg)](https://github.com/MarkusJx/node-java-bridge/actions/workflows/system_test.yml)-->
A bridge between Node.js programs and Java APIs written in Rust using [napi-rs](https://napi.rs/)

@@ -9,0 +10,0 @@ to provide a fast and memory-safe interface between the two languages.

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