Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/extremeheat/nbt-dump
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeheat committed Feb 9, 2021
2 parents b104ec0 + 3b74227 commit 9504e15
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
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 9504e15

Please sign in to comment.