From d529b6b0dcf73eb6b1082d12e2bbfdf7b237189c Mon Sep 17 00:00:00 2001 From: Dmitri Zagidulin Date: Tue, 11 Jun 2024 16:00:11 -0400 Subject: [PATCH] WIP --- README.md | 6 +++--- package.json | 4 +++- test.js | 9 +++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 test.js diff --git a/README.md b/README.md index ef3029d..aec2847 100644 --- a/README.md +++ b/README.md @@ -57,9 +57,9 @@ export() // no wallet passed in, generates an empty Universal Wallet Backup TAR ``` $ tar -vtf wallet-export-2024-01-01.tar -drwxrwxr-x 0 0 4.0K Jun 11 15:38 app/ -drwxrwxr-x 0 0 4.0K Jun 11 15:38 keys/ --rw-rw-r-- 0 0 1K Jun 11 15:38 manifest.yaml +drwxr-xr-x 0/0 0 2024-06-11 15:58 app +drwxr-xr-x 0/0 0 2024-06-11 15:58 keys +-rw-r--r-- 0/0 21 2024-06-11 15:58 manifest.yaml $ cat manifest.yaml --- diff --git a/package.json b/package.json index c1df880..16c3a3f 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,9 @@ }, "./package.json": "./package.json" }, - "dependencies": {}, + "dependencies": { + "tar-stream": "^3.1.7" + }, "devDependencies": { "@types/chai": "^4.3.10", "@types/mocha": "^10.0.4", diff --git a/test.js b/test.js new file mode 100644 index 0000000..7e11777 --- /dev/null +++ b/test.js @@ -0,0 +1,9 @@ +const tar = require('tar-stream') +const pack = tar.pack() // pack is a stream + +pack.entry({ name: 'app', type: 'directory' }) +pack.entry({ name: 'keys', type: 'directory' }) +pack.entry({ name: 'manifest.yaml' }, '---\nubc-version: 0.1\n') + +// pipe the pack stream somewhere +pack.pipe(process.stdout)