https://github.com/kelly-dance/nbt_parser
NBT Data parser for Deno
https://github.com/kelly-dance/nbt_parser
deno minecraft
Last synced: 25 days ago
JSON representation
NBT Data parser for Deno
- Host: GitHub
- URL: https://github.com/kelly-dance/nbt_parser
- Owner: kelly-dance
- Created: 2020-05-20T18:14:44.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-19T21:36:10.000Z (over 4 years ago)
- Last Synced: 2026-05-29T17:04:42.928Z (27 days ago)
- Topics: deno, minecraft
- Language: TypeScript
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nbt_parser
Simple module used to parse nbt data in Deno.
Based on https://github.com/sjmulder/nbt-js
https://deno.land/x/nbt_parser
## How to use
```ts
import { parse, simplify } from 'https://raw.githubusercontent.com/mcbobby123/nbt_parser/master/index.ts';
const data: UInt8Array; // Some NBT data represented as a UInt8Array
const nbt = parse(data);
// To remove type tags use
const simpleNbt = simplify(nbt);
```
## Typing
```ts
import { Tag, Types } from 'https://raw.githubusercontent.com/mcbobby123/nbt_parser/master/index.ts';
// Tag is an Enum containing the ids of each tag type
Tag.byte // 1
Tag.short // 2
Tag.int // 3
// ... etc
// Types maps the ids to their respective types
type IntTag = Types[Tag.int]; // { type: 3, value: number }
```