nbtify-readonly-typeless
v1.1.2
Published
A fork of NBTify which can only read NBT and doesn't have type annotations on every single value.
Maintainers
Readme
NBTify-readonly-typeless
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/[email protected]" // 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-typelessimport * as NBT from "nbtify-readonly-typeless";