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

pteropub

v1.0.1

Published

A CLI tool to Publish files to a Pterodactyl Panel server based on predefined configurations

Downloads

3

Readme

PteroPub

PteroPub is a small TypeScript CLI tool to upload files to Pterodactyl server based on a config. This is primarily aimed at developers who want to quickly upload their files and run tasks on their server, such as reloading or restarts. It may also be used as a part of a CI/CD pipeline.

Configuration

pteropub.json

Create a pteropub.json file in the root of your project. Here is a minimal config:

{
    "uploads": [
        {
            "token": "API_TOKEN",
            "panelUrl": "https://your.panel.dev",
            "serverId": "503a33ee",
            "restartServer": false,
            "task": "Name of Some Schedule",
            "delayToNext": 1000,
            "files": [
                {
                    "localFile": "scratch/somefile.jar",
                    "uploadDir": "/plugins"
                },
                {
                    "localFile": "scratch/someotherfile.jar",
                    "uploadDir": "/plugins"
                }
            ]
        }
    ]
}
  • uploads is an array of upload configurations. You can have multiple configurations if you have multiple servers.
    • token is the API token for the server. This is required.
    • panelUrl is the URL of the panel before /api. This is required.
    • serverId is the short server ID found after /server/ in the URL. This is required.
    • restartServer is a boolean to restart the server after the files are uploaded. Defaults to false.
    • task is the name of the task to run after the files are uploaded. Defaults to null.
    • delayToNext is the time in milliseconds to wait before moving to the next upload configuration. Defaults to 0.
    • files is an array of files to upload. At least one file entry is required.
      • localFile is the path to the file on your local machine. This is required.
      • uploadDir is the directory on the server to upload the file to. Be sure to include the leading /. This is required.

Environment Variables

The config can also be passed as the environment variable PTEROPUB_CONFIG. When set, this will take precedence over the pteropub.json file.

Ignoring The Configuration

If using in a git repository, you'll likely want to add pteropub.json to your .gitignore file. This is because the API token is sensitive information and should not be shared.

pteropub.json

If you are working on a project that does not wish to add this to the .gitignore file, you can add it to your global gitignore file. This is usually located at ~/.gitignore_global. You can then run the following command to add it to your global gitignore file:

macOS, Linux, and Windows Git Bash

echo "pteropub.json" >> ~/.gitignore
git config --global core.excludesfile ~/.gitignore

Windows PowerShell

Add-Content -Path "$Env:USERPROFILE\.gitignore" -Value "pteropub.json"
git config --global core.excludesFile "$Env:USERPROFILE\.gitignore"

Running

Prerequisites

You'll need to install NodeJS to run this tool.

Windows PowerShell

winget install -e --id OpenJS.NodeJS.LTS

macOS

# Install Homebrew if you haven't already
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node

Linux

Use your package manager to install NodeJS. For example, on Ubuntu:

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - &&\
sudo apt install -y nodejs

Usage

Run in a directory containing a pteropub.json file:

npx pteropub

You can also install it globally for easier use:

npm install -g pteropub
pteropub