Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

nbtify-readonly-typeless

SuperLlama88888113MIT1.1.2TypeScript support: included

A fork of NBTify which can only read NBT and doesn't have type annotations on every single value.

javascript, minecraft, typescript, nbt, nbt-parser, minecraft-bedrock-edition, bedrock-edition, java-edition, nbt-library, minecraft-java-edition

readme

NBTify-readonly-typeless

npm

This repository is a fork of NBTify with all functionality except reading NBT files removed. Specialised classes for different types (e.g. Int16 extends Number, Float32 extends Number etc.) have been removed, meaning there is no way to differentiate between different number types. Lists of numbers have also been compacted into TypedArrays, which store numbers much more compactly than individual objects for each number.

Overall, it is much more memory efficient and a little bit faster than NBTify, for the cost of being very limited in functionality.

Please refer to NBTify's readme for more information.

Usage

In the browser:

<script type="importmap">
    {
    "imports": {
      "nbtify-readonly-typeless": "https://esm.sh/nbtify-readonly-typeless@1.1.2" // Remove @1.1.2 to use latest version
    }
  }
</script>
<script type="module">
  import * as NBT from "nbtify-readonly-typeless";

  let file = await fetch("./hermitcraft9.mcstructure").then(res => res.blob());
  let nbt = await NBT.read(file);
  console.log(nbt);
</script>

In Node:

npm i nbtify-readonly-typeless
import * as NBT from "nbtify-readonly-typeless";