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

convert-pack

v1.1.0

Published

Convert a Minecraft resource pack between versions and editions with (relative) ease.

Downloads

4

Readme

What is this project?

convert-pack is a simple set of tools that lets you convert a pack from any edition and version to any other edition and version. It's not just a simple Java to Bedrock converter—if you want to go from Bedrock to 1.12.2, or 1.8.9 to the latest version, or vice versa for either, this tool has got you covered.

This tool is optimized for pack developers trying to port their existing projects, and as such won't make any suboptimal decisions that many other converters make for the sake of filling in missing textures; instead only identical textures will ever be copied. This leaves you free to do whatever you want with version or edition-exclusive textures without worrying about them being broken or not showing up under a missing texture tool.

The program is also designed to never need updating with new versions, since it pulls all texture-related information from the Faithful API online. As such, it does require an internet connection to work, but has the benefit of being very lightweight since no data is stored on your computer.

CLI Usage

The primary use case for this project is installing the package globally for the convert-pack binary. You may need sudo or to run your terminal as administrator to install global packages.

npm i -g convert-pack

The binary uses the syntax:

convert-pack [--options] <input-dir> <output-dir>

If the package hasn't or can't been installed globally, you may need to use npx.

npx convert-pack [--options] <input-dir> <output-dir>

The flags --input-[version|edition] and --output-[version|edition] are used to specify the source and target information required to convert the pack. Abbreviated forms are also available with --iv, --ie, --ov, and --oe (note that two hyphens are still used).

Either an edition or version needs to be provided for the input and output, since otherwise there's not enough information to convert the pack. Both can be provided for additional context if needed.

These are all valid uses of the command:

convert-pack --input-edition java --output-version 1.8.9 ./input ./output
convert-pack --iv 1.12.2 --oe bedrock ./input
convert-pack . ./out --verbose --input-edition bedrock --output-edition java

If an edition is not provided, it defaults to Java (since Bedrock doesn't really have versions to choose from). If a version is not provided, it defaults to the latest version for that edition (this is why either a version or edition is needed).

You can see the man page or run convert-pack --help for more information.

JavaScript Usage

The project has two named exports: convertPack and generateConversionMap. convertPack performs all the I/O operations with file writing and generateConversionMap creates the underlying data structure used to convert a resource pack.

convertPack takes an object with essentially the same options that the CLI provides and the same underlying assumptions.

const { convertPack } = require("convert-pack");

convertPack({
	inputDir: process.cwd(),
	outputDir: process.cwd() + "./out",
	inputVersion: "1.12.2", // infers java
	outputEdition: "bedrock", // infers bedrock-latest
});

generateConversionMap only needs the input and output edition to filter relevant paths.

import { generateConversionMap } from "convert-pack";

// bedrock -> java conversion map
const conversionMap = await generateConversionMap("bedrock", "java");

Credits

This project is powered by the Faithful texture database, and would not be possible without their constantly updated, comprehensive texture data and public API (https://faithfulpack.net).

Copyright (C) 2024 Evorp. Licensed under AGPL-3.0.