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

resourcepacker

v1.2.1

Published

Package Minecraft resource packs easily and cleanly from a messy working directory

Downloads

8

Readme

Latest version npm downloads Last updated

resourcepacker

resourcepacker (or rpkr for short) is a useful tool for packaging Minecraft resource packs from a messy working directory into a clean output folder.

Usage

Command-line

Install resourcepacker on npm by typing npm install -g resourcepacker into the command line.

After installing resourcepacker, cd to the directory your resource is located in, then type rpkr init to ready your directory with a configuration file (.rpkr.json). Customise the values in this configuration file to your liking. For information on how to use this configuration file, please see the Configuration section below.

To package a resource pack, simply type rpkr pack and your resource pack will be packaged into an output folder. You can control which directory the files are outputted to by placing the output folder name in quotes after this command; for example, rpkr pack "My Pack 1.16" outputs to folder "My Pack 1.16". If the output folder is not set in the command line, it defaults to the format "<name> <packver> (<mcver>)", where each value comes from the .rpkr.json file.

Node

Install resourcepacker locally using npm install resourcepacker. Two functions are exported: init and pack.

  • init(options?: object): Initialize with a .rpkr.json configuration file. The following options are available:
    • force: Overwrite an existing .rpkr.json file.
  • pack(input: string, output: string, options?: object): Package a resource pack from folder input into folder output. Set input to "." (a dot) to use the current folder.
    • zipped: Output to a zip file instead of a folder.

Example:

const rpkr = require('resourcepacker')
rpkr.init({force: true})
rpkr.pack('My Pack', 'Output', {zipped: false})

Configuration

The .rpkr.json configuration file can be edited to fine tune the output of your resource pack. Available parameters can be found below, with further explanations found in sub-sections.

Parameters

  • configver: The .rpkr.json file version. Leave as-is.
  • name: The name of your resource pack. Defaults to the name of the current folder.
  • packver: The version of your resource pack. Defaults to "1.0.0".
  • mcver: The Minecraft version your resource pack is made for. Defaults to "1.16.x".
  • mcsnap (optional): The Minecraft development version your resource pack is made for. Blank by default.
  • description (optional): The content in the description field of the automatic pack.mcmeta file. Only generates an automatic pack.mcmeta when set. More information below.
  • languages (optional): A list of languages to add to the automatically-generated pack.mcmeta file.
  • files: File globs that will be passed through into your output folder. More information below.

Description

The description parameter, when set, will be the contents of the description key of an automatically-generated pack.mcmeta file. An automatic pack.mcmeta file is only created when this parameter is set. Other parameters in .rpkr.json can be referenced by placing the parameter name in angle brackets (<>). Color codes can be declared using either ampersands (&) or section signs (§) followed by a hexidecimal digit. The value of the pack_version key in pack.mcmeta is determined by the value of mcver.

For example, a description of &b<name> &l<packver> sets the description key of pack.mcmeta to the value of the name parameter in aqua followed by the contents of the packver parameter in bold.

Languages

The languages parameter is an object where each key is the language code your pack is adding or modifying (which much match a language file inside assets/minecraft/lang) with the value being the name of the language in the format "language (variant)". For example, if your resource pack modifies British English, use "en_gb": "English (United Kingdom)". Multiple custom languages can be added.

Files

You can add or remove any globs (file path formats) as you see fit to the .rpkr.json configuration file under the "files" array; for example, if you have a readme.txt file in the root directory that you want outputted, add readme.txt to the array. Use "**" to specify any number of nested subfolders (including zero) and "*" to specify any string of characters (excluding slashes). By default, the following globs are specified in the files array:

pack.png
pack.mcmeta
assets/**/*.png
assets/**/*.mcmeta
assets/**/*.json
assets/**/lang/**/*.lang
assets/**/texts/**/*.txt
assets/**/sounds/**/*.ogg
assets/**/shaders/**/*.fsh
assets/**/shaders/**/*.bin

Try it out

Clone this repository then type cd resourcepacker && npm install && node . pack to pack the contents of this repository into a clean output folder. You'll see that out of all of the messy files in this folder, only the assets, pack.png, and pack.mcmeta files are outputted.