From 5bac692b975353be57f6747bf7d95fa2fb5b97b0 Mon Sep 17 00:00:00 2001 From: extremeheat Date: Mon, 28 Dec 2020 22:02:05 -0500 Subject: [PATCH 1/2] Update README.md --- README.md | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) 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 +``` From 3b7422796bccf3bc4cc651d0c83af4e95f69442e Mon Sep 17 00:00:00 2001 From: extremeheat Date: Tue, 29 Dec 2020 07:45:03 -0500 Subject: [PATCH 2/2] add GitHub ci --- .github/workflows/node.js.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..c860800 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -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