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

portablemc_npm

v1.24.0

Published

This module aims to convert the excellent work by [mindstorm38](https://github.com/mindstorm38) into an NPM module in order to be used in many NodeJS based projects.

Downloads

4

Readme

PortableMC_NPM

This module aims to convert the excellent work by mindstorm38 into an NPM module in order to be used in many NodeJS based projects.

Compatability

The package is compatible with Windows and Linux Clients

Installation

Install the package using npm

npm install portablemc

This package also requires that portablemc is installed on the system. The package will search in its default installation locations.

Getting Started

.config(options)

This function tells the package some key pieces of information:

EXE_LOCATION : Path to the PortableMC Application LOG_LOCATION : Path to logs location MAIN_DIR : Path where minecraft will be installed

All values have defaults however the package will error if portablemc is not found. In this case manual declaration may be needed.

portablemc.config({
    EXE_LOCATION: PATH_TO_EXE
    LOG_LOCATION: PATH_TO_LOG,
    MAIN_DIR:PATH_TO_MC_INSTALLATION
});

.authenticate(email)

This function determines which user is used to boot into the minecraft instance. It can be used both standalone and asynchronously which will return a result

portablemc.authenticate(EMAIL);

or

const authenticatedUser = await portablemc.authenticate(EMAIL);
{
  "username": "USERNAME",
  "uuid": "UUID",
  "email": "EMAIL (Obsfucated)"
}

Once this function is run it stores the user and will use it to launch later sessions.

.launchGame(options,installOnly)

This functions boots an instance of minecraft with the following conditions:

{
    "version":"MC VERSION",
    "loader": "LOADER"
}

Version : accepts any version. Also accepts release and snapshot

Loader : accepts the following

  • Standard (Vanilla)
  • Forge
  • Fabric
  • NeoForge
  • Quilt
  • LegacyFabric

Currently there is no check to ensure that the version selected supports the loader. This will be addressed in a future version.

installOnly

Setting this to true will stop the launch of the game and only install it.

This function can be called normaly and asynchronously

portablemc.launchGame(options,false);

or

const launchGameVersion = await portablemc.launchGame(options,false);

Other Functions

.getAuthedUsers()

const authenticatedUsers = portablemc.getAuthedUsers()

Returns an array of authenticated users

.logout(email)

const logoutUser = await portablemc.logout(email)

Logs the user out