tmcsplit 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/eslint.config.mjs CHANGED
@@ -38,6 +38,9 @@ const
38
38
  "node_modules/**",
39
39
  "eslint.config.js",
40
40
  "fs-worker.js",
41
+ "**/*.fs-worker.js",
42
+ `**/*.${_project}.js`,
43
+ `**/*.lib${_project}.js`,
41
44
  "man/**"
42
45
  ];
43
46
  export default defineConfig([
@@ -71,9 +74,7 @@ export default defineConfig([
71
74
  "prefer-const":
72
75
  "error" },
73
76
  files:
74
- [ "**/*.js",
75
- `**/${_project}*`,
76
- `**/lib${_project}`,
77
+ [ "**/*.{cjs,js}",
77
78
  ],
78
79
  languageOptions:
79
80
  { sourceType:
@@ -49,11 +49,11 @@ module.exports = {
49
49
  "fs":
50
50
  _path.resolve(
51
51
  __dirname,
52
- 'node_modules/fs/fs'),
52
+ 'node_modules/tmcfs/fs'),
53
53
  "opfs":
54
54
  _path.resolve(
55
55
  __dirname,
56
- 'node_modules/fs/fs'),
56
+ 'node_modules/opfs/opfs'),
57
57
  "path":
58
58
  _path.resolve(
59
59
  __dirname,
package/libtmcsplit CHANGED
@@ -33,37 +33,61 @@
33
33
  "local" } ] */
34
34
 
35
35
  const
36
- _split_file_module =
37
- require(
38
- 'split-file');
39
- const
40
- _split_file =
41
- _split_file_module._split_file;
42
- const
43
- _split_file_by_size =
44
- _split_file_module._split_file_by_size;
36
+ _libcrash_module =
37
+ await import(
38
+ "libcrash-js");
45
39
  const
46
40
  _libcrash =
47
- require(
48
- 'crash-js');
41
+ _libcrash_module.default;
42
+ /* global
43
+ _basename */
49
44
  const
50
45
  _basename =
51
46
  _libcrash._basename;
47
+ /* global
48
+ _dirname */
52
49
  const
53
50
  _dirname =
54
51
  _libcrash._dirname;
52
+ /* global
53
+ _ls */
55
54
  const
56
55
  _ls =
57
56
  _libcrash._ls;
58
- const
59
- _msg_info =
60
- _libcrash._msg_info;
57
+ /* global
58
+ _msg_error */
61
59
  const
62
60
  _msg_error =
63
61
  _libcrash._msg_error;
62
+ /* global
63
+ _msg_info */
64
+ const
65
+ _msg_info =
66
+ _libcrash._msg_info;
67
+ /* global
68
+ _mv */
64
69
  const
65
70
  _mv =
66
71
  _libcrash._mv;
72
+ /* global
73
+ _require */
74
+ const
75
+ _require =
76
+ _libcrash._require;
77
+ const
78
+ _split_file_module =
79
+ await _require(
80
+ "split-file");
81
+ /* global
82
+ _split_file */
83
+ const
84
+ _split_file =
85
+ _split_file_module._split_file;
86
+ /* global
87
+ _split_file_by_size */
88
+ const
89
+ _split_file_by_size =
90
+ _split_file_module._split_file_by_size;
67
91
 
68
92
  async function
69
93
  _output_files_get(
@@ -161,7 +185,15 @@ async function
161
185
  return _output_files;
162
186
  }
163
187
 
164
- module.exports = {
165
- _split:
166
- _split
188
+ // ES exports
189
+
190
+ export {
191
+ _split
167
192
  };
193
+
194
+ // Common Javascript exports
195
+
196
+ // module.exports = {
197
+ // _split:
198
+ // _split
199
+ // };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name":
3
3
  "tmcsplit",
4
4
  "version":
5
- "0.0.11",
5
+ "0.0.13",
6
6
  "description":
7
7
  "Basic Javascript implementation of GNU Split.",
8
8
  "funding": {
@@ -22,7 +22,6 @@
22
22
  "package.json",
23
23
  "tmcsplit",
24
24
  "fs-worker.webpack.config.cjs",
25
- "index.html",
26
25
  "serve.json",
27
26
  "libtmcsplit",
28
27
  "libtmcsplit.webpack.config.cjs",
@@ -57,7 +56,7 @@
57
56
  },
58
57
  "devDependencies": {
59
58
  "crash-js-webpack":
60
- "^0.0.27",
59
+ "^0.0.56",
61
60
  "eslint":
62
61
  "^10.0.3",
63
62
  "globals":
@@ -65,20 +64,24 @@
65
64
  "@eslint/js":
66
65
  "^10.0.1",
67
66
  "safely-serve":
68
- "^0.0.9",
67
+ "^0.0.14",
69
68
  "webpack":
70
- "^5.102.1",
69
+ "^5.109.2",
71
70
  "webpack-cli":
72
- "^6.0.1"
71
+ "^7.2.2"
73
72
  },
74
73
  "dependencies": {
75
- "crash-js":
76
- "^0.1.133",
74
+ "libcrash-js":
75
+ "npm:crash-js@^11.1000000000000001.1000000000000001",
77
76
  "split-file":
78
77
  "npm:@themartiancompany/split-file@2.3.15"
79
78
  },
79
+ "overrides": {
80
+ "split":
81
+ "./libtmcsplit"
82
+ },
80
83
  "type":
81
- "commonjs",
84
+ "module",
82
85
  "main":
83
86
  "libtmcsplit",
84
87
  "bin":
package/tmcsplit CHANGED
@@ -35,10 +35,13 @@
35
35
  "argsIgnorePattern":
36
36
  "output_prefix" } ] */
37
37
 
38
+ const
39
+ _libcrash_module =
40
+ await import(
41
+ 'libcrash-js');
38
42
  const
39
43
  _libcrash =
40
- require(
41
- 'crash-js');
44
+ _libcrash_module.default;
42
45
  /* global
43
46
  _argv_url_get */
44
47
  const
@@ -49,6 +52,16 @@ _argv_url_get =
49
52
  const
50
53
  _cmdline_check =
51
54
  _libcrash._cmdline_check;
55
+ /* global
56
+ _echo */
57
+ const
58
+ _echo =
59
+ _libcrash._echo;
60
+ /* global
61
+ _exit */
62
+ const
63
+ _exit =
64
+ _libcrash._exit;
52
65
  /* global
53
66
  _msg_info */
54
67
  const
@@ -59,6 +72,16 @@ const
59
72
  const
60
73
  _msg_error =
61
74
  _libcrash._msg_error;
75
+ /* global
76
+ _override_set */
77
+ const
78
+ _override_set =
79
+ _libcrash._override_set;
80
+ /* global
81
+ _require */
82
+ const
83
+ _require =
84
+ _libcrash._require;
62
85
  /* global
63
86
  _yargv_get */
64
87
  const
@@ -66,7 +89,7 @@ _yargv_get =
66
89
  _libcrash._yargv_get;
67
90
  const
68
91
  _split_module =
69
- require(
92
+ await _require(
70
93
  "./libtmcsplit");
71
94
  /* global
72
95
  _tmcsplit */
@@ -79,59 +102,82 @@ function
79
102
  /* global
80
103
  app_name:
81
104
  writable */
82
- app_name =
83
- "tmcsplit";
105
+ _override_set(
106
+ "app",
107
+ "name",
108
+ "tmcsplit");
84
109
  /* global
85
110
  app_opts:
86
111
  writable */
87
- app_opts =
88
- [];
112
+ _override_set(
113
+ "app",
114
+ "opts",
115
+ []);
89
116
  /* global
90
117
  runtime_environment:
91
118
  writable */
92
- runtime_environment =
93
- "";
119
+ _override_set(
120
+ "runtime",
121
+ "environment",
122
+ "");
94
123
  /* global
95
124
  numeric_suffix:
96
125
  writable */
97
- numeric_suffix =
98
- "";
126
+ _override_set(
127
+ "numeric",
128
+ "suffix",
129
+ "");
99
130
  /* global
100
131
  suffix_length:
101
132
  writable */
102
- suffix_length =
103
- "";
133
+ _override_set(
134
+ "suffix",
135
+ "length",
136
+ "");
104
137
  /* global
105
138
  chunks_amount:
106
139
  writable */
107
- chunks_amount =
108
- "";
140
+ _override_set(
141
+ "chunks",
142
+ "amount",
143
+ "");
109
144
  // string_length =
110
145
  // "";
111
146
  /* global
112
147
  size_max:
113
148
  writable */
114
- size_max =
115
- "";
149
+ _override_set(
150
+ "size",
151
+ "max",
152
+ "");
116
153
  /* global
117
154
  input_file:
118
155
  writable */
119
- input_file =
120
- "";
156
+ _override_set(
157
+ "input",
158
+ "file",
159
+ "");
121
160
  /* global
122
161
  output_prefix:
123
162
  writable */
124
- output_prefix =
125
- "";
163
+ _override_set(
164
+ "output",
165
+ "prefix",
166
+ "");
126
167
  /* global
127
168
  quiet:
128
169
  writable */
129
- quiet =
170
+ const
171
+ _global =
172
+ _global_get();
173
+ _global[
174
+ "quiet"] =
130
175
  "";
131
176
  /* global
132
177
  verbose:
133
178
  writable */
134
- verbose =
179
+ _global[
180
+ "verbose"] =
135
181
  "";
136
182
  }
137
183
 
@@ -231,10 +277,10 @@ function
231
277
  " splitting lines/records",
232
278
  ];
233
279
  for ( _line of _text ) {
234
- console.log(
280
+ _echo(
235
281
  _line);
236
282
  }
237
- process.exit(
283
+ _exit(
238
284
  _exit_code);
239
285
  }
240
286
 
@@ -364,7 +410,7 @@ function
364
410
  _global_variables();
365
411
  _overrides_set();
366
412
  if ( _cmdline_check(
367
- "tmcsplit") == true ) {
413
+ "tmcsplit") ) {
368
414
  _cmdline_parse();
369
415
  }
370
416
  else {
@@ -90,11 +90,19 @@ module.exports = {
90
90
  "fs":
91
91
  _path.resolve(
92
92
  __dirname,
93
- 'node_modules/fs/fs'),
93
+ 'node_modules/tmcfs/fs'),
94
+ "opfs":
95
+ _path.resolve(
96
+ __dirname,
97
+ 'node_modules/opfs/opfs'),
94
98
  "path":
95
99
  _path.resolve(
96
100
  __dirname,
97
101
  'node_modules/path/mod.js'),
102
+ "split":
103
+ _path.resolve(
104
+ __dirname,
105
+ 'libtmcsplit'),
98
106
  "web-worker":
99
107
  _path.resolve(
100
108
  __dirname,