encoding-tools 0.0.11 → 0.0.12

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/libbin2txt CHANGED
@@ -59,11 +59,6 @@ const
59
59
  const
60
60
  _file_exists =
61
61
  _libcrash._file_exists;
62
- /* global
63
- _file_read */
64
- const
65
- _file_read =
66
- _libcrash._file_read;
67
62
  /* global
68
63
  _file_write */
69
64
  const
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
- "fs");
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
- _data,
179
- _output_file);
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
- _assemble(
220
- _txt,
221
- _input_files,
222
- _argument_type);
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
- console.log(
229
- _base64_stream_module);
230
- console.log(
231
- _base64_stream_module.Base64Encode);
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
- await _base64_decode(
293
- _output_file,
294
- _input_files,
295
- _argument_type);
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.11",
5
+ "0.0.12",
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.25",
63
+ "^0.0.26",
64
64
  "eslint":
65
65
  "^10.3.0",
66
66
  "globals":
@@ -80,9 +80,9 @@
80
80
  "base64-stream":
81
81
  "^1.0.0",
82
82
  "crash-js":
83
- "^0.1.130",
84
- "fs":
85
- "npm:@themartiancompany/fs@^0.0.8",
83
+ "^0.1.133",
84
+ "tmcfs":
85
+ "npm:@themartiancompany/fs@^0.0.12",
86
86
  "tmcsplit":
87
87
  "^0.0.10",
88
88
  "yargs":
package/txt2bin CHANGED
@@ -192,7 +192,6 @@ function
192
192
  ` Output file: ${output_file}`,
193
193
  ` Input text file(s): ${input_texts}`,
194
194
  ];
195
- _msg_info("perche");
196
195
  for ( _line of _text ) {
197
196
  _msg_info(
198
197
  _line);