npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

javabin

v1.0.3

Published

Package used to download java binaries for Linux, Windows and Mac Os.

Downloads

39

Readme

JavaBin

NPM VERSION DOWNLOADS LICENSE BUILD Codacy Badge Codacy Badge

JavaBin is a library that can be used to download all Amazon Corretto resources from Node.js.

Table of Contents:

Documentation

Install

To add this librery to your proyect use this command.

npm i javabin

If you want use the CLI use this command.

npm i -g javabin

To get help of javabin CLI use command javabin -h.

Getting Started

To use this librery you need to import it frist.

import JavaBin from "javabin";

// or

const JavaBin = require("javabin");

and before get an instance.

const JavaVersion = JavaBin.getInstance(); // Returns Promise<JavaVersion>

The method getInstance request all data from the oficial github of Amazon Corretto.

JavaVersion Class

List Platforms

If you want list all platforms available you can use this method.

JavaVersion.listPlatforms();

This method returns array all platforms.

List Architectures of Platform

Parameters:

  • platform: The name of the platform from which you want to obtain its architectures.

Returns:

It method returns an array with all architectures.

JavaVersion.getPlatformArchs("windows");

List Architectures

This method list all platforms with their respective architectures.

Returns:

This method returns an object with each platform in the keys and in each one an array with its possible architectures.

Example:

{
    "windows": ["x64", "x86"],
    "linux": ["x64", "x86", "arm"],
    ...
}
JavaVersion.listArchs();

Get Platform

Parameters:

  • Platform: The name of platform.
  • Arch: The architecture you need.

Returns:

This method return an Platform class instance.

JavaVersion.platform("linux","x64");

Platform Class

List JRE versions

This method list all JRE versions that are available.

JavaVersion.platform("linux", "x64").listJreVersions();

List JDK versions

This method list all JDK versions that are available.

JavaVersion.platform("linux", "x64").listJdkVersions();

List Versions

This method list all versions that are available.

Returns:

An object with two keys (JRE, JDK) and in each of its available versions.

Example:

{
    "jdk": ["8", "11"...],
    "jre": ["8", "11"...]
}
JavaVersion.platform("linux", "x64").listVersions();

Get JRE version

To get an JRE version you can use this method.

Parameters:

  • Version: The version you want get.

Returns:

This method return an instance of JavaBinariesFormats.

JavaVersion.platform("windows","x64").jre(8);

Get JDK version

To get an JDK version you can use this method.

Parameters:

  • Version: The version you want get.

Returns:

This method return an instance of JavaBinariesFormats.

JavaVersion.platform("windows","x64").jdk(11);

JavaBinariesFomarts Class

This class is used to select the format of JavaBinary.

List Formats

This method is used to list all formats for JavaBinary.

Returns:

Returns array with all formats.

Example:

[
    "zip", "msi", "exe"...
]
JavaVersion.platform("win", "x64").jdk(11).listFormats();

Get JavaBinary for format

This method is used to get an format for JavaVersion.

Returns:

Returns an instance of JavaBinary.

JavaVersion.platform("win", "x64").jdk(11).format("zip");

JavaBinary class

GetDownloadURL

Method getDownloadUrl:

This method returns the download url for the JavaBinary.

Download

Method download:

This method download return an IncomingDownload.

Parameters:

  • downloadPath optional: The path where the binary is downloaded. If you not specify an path will be downloaded in the current working directory.

IncomingDownload

Events

Start

This event is triggered when the download starts.

Callback value:

Object:

{
    "total": 100,
    "javaBin": {...} // JavaBinary instance
}

Tick

This event is triggered when the download process advances.

Callback value:

Object:

{
    "total": 5616424,
    "tick": 15852
}

Complete

This event is triggered when the download process ends.

Callback value:

Object:

{
    "path":"path_to_java_binary",
    "filename": "java_binary_file_name",
    "javaBinary": {...} // JavaBinary instance
}