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

pack-format

v1.4.0

Published

Returns the pack_format of any Minecraft version, including snapshots

Downloads

455

Readme

Latest version npm downloads Last updated

pack-format

pack-format is a tool for retrieving the pack_format of any Minecraft version, including snapshots.

Updated for: 1.21.1 & 24w34a

About

pack_format is a version number used by Minecraft in both resource packs and data packs for labeling compatible versions. It was added in Minecraft version 1.6, and as such using this tool on any version prior to that will just return undefined.

Install

pack-format is available on npm. You must have Node.js installed to be able to use this.

To install pack-format, open the command line and type npm install pack-format to use for a Node.js project, or npm install -g pack-format to use from the command line.

Usage

Node

Retrieve the pack_format of a given Minecraft version, optionally specifying whether the resource (default) or data pack version should be returned.

const packFormat = require('pack-format')
packFormat('1.14.4') // 4
packFormat('1.16.2-pre1', 'resource') // 5
packFormat('20w45a', 'data') // 6
packFormat.LATEST.data // 58
packFormat.LATEST.version // 1.21.2

Retrieve a list of versions corresponding to a specific pack_format, again optionally specifying resource/data pack version.

const {getVersions} = require('pack-format')
getVersions(3) // { releases: { min: '1.11.x', max: '1.12.x' }, snapshots: { min: '16w32a', max: '17w47a' } }
getVersions(6, 'data') // { releases: { min: '1.15.x', max: '1.16.1' }, snapshots: { min: '20w06a', max: '20w44a' } }

Command line

Retrieve both the resource and data pack_format of a given Minecraft version:

pack-format [--data|--resource] <version>

Retrieve a list of corresponding Minecraft versions:

pack-format --list [--data|--resource] <pack_format>

Examples:

> pack-format 1.14.4
Resource pack format of 1.14.4 is 4
Data pack format of 1.14.4 is 4

> pack-format --resource 1.16.2-pre1
Resource pack format of 1.16.2-pre1 is 5

> pack-format --data 20w45a
Data pack format of 20w45a is 6

> pack-format --list --resource 3
{ releases: { min: '1.11.x', max: '1.12.x' }, snapshots: { min: '16w32a', max: '17w47a' } }