encoding-tools 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin2txt/bin2txt.js +1 -1
- package/dist/bin2txt/fs-worker.js +1 -1
- package/dist/encoding-tools/encoding-tools.js +1 -1
- package/dist/encoding-tools/fs-worker.js +1 -1
- package/dist/libbin2txt/fs-worker.js +1 -1
- package/dist/libbin2txt/libbin2txt.js +1 -1
- package/dist/libtxt2bin/fs-worker.js +1 -1
- package/dist/libtxt2bin/libtxt2bin.js +1 -1
- package/dist/txt2bin/fs-worker.js +1 -1
- package/dist/txt2bin/txt2bin.js +1 -1
- package/libbin2txt +0 -5
- package/libtxt2bin +44 -18
- package/package.json +6 -6
- package/txt2bin +0 -1
package/libbin2txt
CHANGED
package/libtxt2bin
CHANGED
|
@@ -34,10 +34,13 @@ const
|
|
|
34
34
|
_base64_stream_module =
|
|
35
35
|
require(
|
|
36
36
|
"base64-stream");
|
|
37
|
+
const
|
|
38
|
+
_base64_decode_stream =
|
|
39
|
+
_base64_stream_module.Base64Decode;
|
|
37
40
|
const
|
|
38
41
|
_fs_module =
|
|
39
42
|
require(
|
|
40
|
-
"
|
|
43
|
+
"tmcfs");
|
|
41
44
|
const
|
|
42
45
|
_write_stream_create =
|
|
43
46
|
_fs_module.createWriteStream;
|
|
@@ -141,8 +144,8 @@ const
|
|
|
141
144
|
|
|
142
145
|
async function
|
|
143
146
|
_assemble(
|
|
144
|
-
_input_files,
|
|
145
147
|
_output_file,
|
|
148
|
+
_input_files,
|
|
146
149
|
_argument_type) {
|
|
147
150
|
let
|
|
148
151
|
_data,
|
|
@@ -175,13 +178,14 @@ async function
|
|
|
175
178
|
_file_read(
|
|
176
179
|
_file);
|
|
177
180
|
_file_append(
|
|
178
|
-
|
|
179
|
-
|
|
181
|
+
_output_file,
|
|
182
|
+
_data);
|
|
180
183
|
}
|
|
181
184
|
_msg =
|
|
182
185
|
`Merging finished.`;
|
|
183
186
|
_msg_info(
|
|
184
187
|
_msg);
|
|
188
|
+
return true;
|
|
185
189
|
}
|
|
186
190
|
|
|
187
191
|
async function
|
|
@@ -210,25 +214,44 @@ async function
|
|
|
210
214
|
const
|
|
211
215
|
_tmp_dir =
|
|
212
216
|
await _mktemp();
|
|
213
|
-
console.log(
|
|
214
|
-
_tmp_dir);
|
|
215
217
|
_txt =
|
|
216
218
|
_path_join( [
|
|
217
219
|
_tmp_dir,
|
|
218
220
|
"merge.base64" ]);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
const
|
|
222
|
+
_assembled =
|
|
223
|
+
await _assemble(
|
|
224
|
+
_txt,
|
|
225
|
+
_input_files,
|
|
226
|
+
_argument_type);
|
|
223
227
|
}
|
|
224
228
|
_msg =
|
|
225
229
|
`Decoding '${_txt}' into '${_output_file}'`;
|
|
226
230
|
_msg_info(
|
|
227
231
|
_msg);
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
+
const
|
|
233
|
+
_read_opts =
|
|
234
|
+
{"encoding":
|
|
235
|
+
null,
|
|
236
|
+
"flag":
|
|
237
|
+
'r'};
|
|
238
|
+
const
|
|
239
|
+
_txt_stream =
|
|
240
|
+
_read_stream_create(
|
|
241
|
+
_txt);
|
|
242
|
+
const
|
|
243
|
+
_output_file_stream =
|
|
244
|
+
_write_stream_create(
|
|
245
|
+
_output_file);
|
|
246
|
+
const
|
|
247
|
+
_base64_decoder =
|
|
248
|
+
new _base64_decode_stream();
|
|
249
|
+
const
|
|
250
|
+
_write_stream =
|
|
251
|
+
_txt_stream.pipe(
|
|
252
|
+
_base64_decoder).pipe(
|
|
253
|
+
_output_file_stream);
|
|
254
|
+
return _write_stream;
|
|
232
255
|
}
|
|
233
256
|
|
|
234
257
|
function
|
|
@@ -289,10 +312,13 @@ async function
|
|
|
289
312
|
_input_files);
|
|
290
313
|
}
|
|
291
314
|
if ( _encoding_format == "base64" ) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
315
|
+
const
|
|
316
|
+
_write_stream =
|
|
317
|
+
await _base64_decode(
|
|
318
|
+
_output_file,
|
|
319
|
+
_input_files,
|
|
320
|
+
_argument_type);
|
|
321
|
+
return _write_stream;
|
|
296
322
|
}
|
|
297
323
|
}
|
|
298
324
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name":
|
|
3
3
|
"encoding-tools",
|
|
4
4
|
"version":
|
|
5
|
-
"0.0.
|
|
5
|
+
"0.0.13",
|
|
6
6
|
"description":
|
|
7
7
|
"A multi-language collection of encoding tools.",
|
|
8
8
|
"funding": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"crash-js-webpack":
|
|
63
|
-
"^0.0.
|
|
63
|
+
"^0.0.26",
|
|
64
64
|
"eslint":
|
|
65
65
|
"^10.3.0",
|
|
66
66
|
"globals":
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
"base64-stream":
|
|
81
81
|
"^1.0.0",
|
|
82
82
|
"crash-js":
|
|
83
|
-
"^0.1.
|
|
84
|
-
"
|
|
85
|
-
"npm:@themartiancompany/fs@^0.0.
|
|
83
|
+
"^0.1.133",
|
|
84
|
+
"tmcfs":
|
|
85
|
+
"npm:@themartiancompany/fs@^0.0.12",
|
|
86
86
|
"tmcsplit":
|
|
87
|
-
"^0.0.
|
|
87
|
+
"^0.0.11",
|
|
88
88
|
"yargs":
|
|
89
89
|
"18.0.0"
|
|
90
90
|
},
|