Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeheat authored Dec 29, 2020
1 parent 6e12205 commit 5bac692
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ Uses `prismarine-nbt` for serialization and deserialization, see https://github.
### Usage

via npx:
`npx nbt-dump --help`
```sh
npx nbt-dump --help
```

via npm:
`npm install -g nbt-dump`
`nbt-dump --help`
```
npm install -g nbt-dump
nbt-dump --help
```

```sh
```
usage, feel free to use natural language:
Parse an NBT file to JSON:
nbt-dump <path-to-nbt-file> [out-json-file] [little|big|varint]
Expand All @@ -27,4 +31,27 @@ Write an JSON file to uncompressed NBT (defaults to big endian):
nbt-dump write level.json to level.dat
nbt-dump write level.json to level.dat as little
```
```

### Example

If you do not specify endianness, it will automatically be inferred.

Parse to json, and back to nbt as big endian
```sh
$ nbt-dump level.dat level.json
* Dumping NBT file "file.nbt" to "file.json" as JSON
(as big endian)
$ nbt-dump write level.json level.dat
* Writing JSON from "file.json" to "file.nbt" as big endian
written!
```

Write as little endian
```sh
$ nbt-dump level.dat level.json
* Dumping NBT file "file.nbt" to "file.json" as JSON
(as big endian)
$ nbt-dump write level.json level.dat little
* Writing JSON from "file.json" to "file.nbt" as little endian
```

0 comments on commit 5bac692

Please sign in to comment.