diff --git a/README.md b/README.md index d7e513b..5e162f3 100644 --- a/README.md +++ b/README.md @@ -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 [out-json-file] [little|big|varint] @@ -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 -``` \ No newline at end of file +``` + +### 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 +```