libcoreutils 0.0.1 → 0.0.24
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/README.md +20 -17
- package/base64.webpack.config.cjs +142 -0
- package/dist/libcoreutils/fs-worker.js +1 -0
- package/dist/libcoreutils/index.html +31 -0
- package/dist/libcoreutils/libcoreutils.js +1 -0
- package/eslint.config.mjs +1 -3
- package/libbase64 +1 -1
- package/libcoreutils +51 -0
- package/package.json +18 -10
- package/webpack.config.cjs +1 -1
- package/dist/base64/base64.js +0 -1
package/README.md
CHANGED
|
@@ -26,18 +26,21 @@
|
|
|
26
26
|
https://img.shields.io/npm/last-update/tmcsplit)](
|
|
27
27
|
https://npmjs.org/package/tmcsplit)
|
|
28
28
|
|
|
29
|
-
Javascript GNU
|
|
29
|
+
Javascript of some GNU Corutils programs.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Includes `base64`.
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
The Coreutils library is part of
|
|
34
|
+
[`senzacoreutils`](
|
|
35
|
+
https://github.com/themartiancompany/senzacoreutils).
|
|
36
|
+
|
|
37
|
+
It uses the
|
|
38
|
+
[Encoding Tools](
|
|
39
|
+
https://github.com/themartiancompany/encoding-tools)
|
|
40
|
+
and the
|
|
35
41
|
[Crash Javacript](
|
|
36
42
|
https://github.com/themartiancompany/crash-js)
|
|
37
|
-
|
|
38
|
-
[Split File](
|
|
39
|
-
https://github.com/themartiancompany/node-split-file)
|
|
40
|
-
modules.
|
|
43
|
+
library modules.
|
|
41
44
|
|
|
42
45
|
### Installation
|
|
43
46
|
|
|
@@ -48,27 +51,27 @@ with the following command:
|
|
|
48
51
|
npm \
|
|
49
52
|
install \
|
|
50
53
|
--save \
|
|
51
|
-
|
|
54
|
+
"libcoreutils"
|
|
52
55
|
```
|
|
53
56
|
|
|
54
|
-
You can then run the
|
|
57
|
+
You can then run one of the programs with
|
|
55
58
|
|
|
56
59
|
```bash
|
|
57
60
|
npx \
|
|
58
|
-
"
|
|
61
|
+
"base64"
|
|
59
62
|
```
|
|
60
63
|
|
|
61
|
-
or just with `
|
|
64
|
+
or just with `base64.js` if you have installed
|
|
62
65
|
the program system-wide using npm from this source
|
|
63
66
|
repository or from the
|
|
64
67
|
[NPM Registry](
|
|
65
|
-
https://www.npmjs.com/package/
|
|
68
|
+
https://www.npmjs.com/package/libcoreutils)
|
|
66
69
|
|
|
67
70
|
```
|
|
68
71
|
npm \
|
|
69
72
|
-g \
|
|
70
73
|
install \
|
|
71
|
-
"
|
|
74
|
+
"libcoreutils"
|
|
72
75
|
```
|
|
73
76
|
|
|
74
77
|
or if using GNU make in this repository
|
|
@@ -90,14 +93,14 @@ package from the
|
|
|
90
93
|
|
|
91
94
|
```bash
|
|
92
95
|
ur \
|
|
93
|
-
|
|
96
|
+
"nodejs-libcoreutils"
|
|
94
97
|
```
|
|
95
98
|
|
|
96
99
|
### Documentation
|
|
97
100
|
|
|
98
101
|
Upon installation the manual can be accessed with
|
|
99
|
-
`man
|
|
100
|
-
GNU Split, so you can also refer to `man
|
|
102
|
+
`man base64.js` but really it's the same as
|
|
103
|
+
GNU Split, so you can also refer to `man base64`
|
|
101
104
|
for what is it implemented.
|
|
102
105
|
|
|
103
106
|
# License
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/** ----------------------------------------------------------------------
|
|
2
|
+
* base64.webpack.config.js
|
|
3
|
+
* ----------------------------------------------------------------------
|
|
4
|
+
* Copyright ©
|
|
5
|
+
* Pellegrino Prevete
|
|
6
|
+
* 2024, 2025, 2026
|
|
7
|
+
*
|
|
8
|
+
* All rights reserved
|
|
9
|
+
* ----------------------------------------------------------------------
|
|
10
|
+
*
|
|
11
|
+
* This program is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const
|
|
26
|
+
_path =
|
|
27
|
+
require(
|
|
28
|
+
'path');
|
|
29
|
+
const
|
|
30
|
+
_output_dir =
|
|
31
|
+
_path.resolve(
|
|
32
|
+
__dirname);
|
|
33
|
+
const
|
|
34
|
+
_input_file_name =
|
|
35
|
+
`base64`;
|
|
36
|
+
const
|
|
37
|
+
_input_file_path =
|
|
38
|
+
`./${_input_file_name}`;
|
|
39
|
+
const
|
|
40
|
+
_output_file_name =
|
|
41
|
+
`${_input_file_name}.js`;
|
|
42
|
+
const
|
|
43
|
+
_output = {
|
|
44
|
+
path:
|
|
45
|
+
_output_dir,
|
|
46
|
+
filename:
|
|
47
|
+
_output_file_name
|
|
48
|
+
};
|
|
49
|
+
const
|
|
50
|
+
_node_fs_ignore =
|
|
51
|
+
{ resourceRegExp:
|
|
52
|
+
/^node:fs$/ };
|
|
53
|
+
const
|
|
54
|
+
_yargs_ignore =
|
|
55
|
+
{ resourceRegExp:
|
|
56
|
+
/^yargs$/ };
|
|
57
|
+
const
|
|
58
|
+
_yargs_helpers_ignore =
|
|
59
|
+
{ resourceRegExp:
|
|
60
|
+
/^yargs\/helpers$/ };
|
|
61
|
+
const
|
|
62
|
+
_webpack =
|
|
63
|
+
require(
|
|
64
|
+
"webpack");
|
|
65
|
+
const
|
|
66
|
+
_ignore_plugin =
|
|
67
|
+
_webpack.IgnorePlugin;
|
|
68
|
+
const
|
|
69
|
+
_node_fs_ignore_plugin =
|
|
70
|
+
new _ignore_plugin(
|
|
71
|
+
_node_fs_ignore);
|
|
72
|
+
const
|
|
73
|
+
_yargs_ignore_plugin =
|
|
74
|
+
new _ignore_plugin(
|
|
75
|
+
_yargs_ignore);
|
|
76
|
+
const
|
|
77
|
+
_yargs_helpers_ignore_plugin =
|
|
78
|
+
new _ignore_plugin(
|
|
79
|
+
_yargs_helpers_ignore);
|
|
80
|
+
module.exports = {
|
|
81
|
+
entry:
|
|
82
|
+
_input_file_path,
|
|
83
|
+
output:
|
|
84
|
+
_output,
|
|
85
|
+
optimization: {
|
|
86
|
+
moduleIds: 'deterministic',
|
|
87
|
+
},
|
|
88
|
+
resolve: {
|
|
89
|
+
alias: {
|
|
90
|
+
"fs":
|
|
91
|
+
_path.resolve(
|
|
92
|
+
__dirname,
|
|
93
|
+
'node_modules/tmcfs/fs'),
|
|
94
|
+
"opfs":
|
|
95
|
+
_path.resolve(
|
|
96
|
+
__dirname,
|
|
97
|
+
'node_modules/opfs/opfs'),
|
|
98
|
+
"path":
|
|
99
|
+
_path.resolve(
|
|
100
|
+
__dirname,
|
|
101
|
+
'node_modules/path/mod.js'),
|
|
102
|
+
"split":
|
|
103
|
+
_path.resolve(
|
|
104
|
+
__dirname,
|
|
105
|
+
'libtmcsplit'),
|
|
106
|
+
"web-worker":
|
|
107
|
+
_path.resolve(
|
|
108
|
+
__dirname,
|
|
109
|
+
'node_modules/web-worker/mod.js'),
|
|
110
|
+
"yargs":
|
|
111
|
+
_path.resolve(
|
|
112
|
+
__dirname,
|
|
113
|
+
'node_modules/yargs/browser.mjs'),
|
|
114
|
+
"yargs/helpers":
|
|
115
|
+
_path.resolve(
|
|
116
|
+
__dirname,
|
|
117
|
+
'node_modules/yargs/helpers/helpers.mjs'),
|
|
118
|
+
"yargs-parser":
|
|
119
|
+
_path.resolve(
|
|
120
|
+
__dirname,
|
|
121
|
+
'node_modules/yargs-parser/browser.mjs'),
|
|
122
|
+
},
|
|
123
|
+
fallback: {
|
|
124
|
+
"utils":
|
|
125
|
+
false,
|
|
126
|
+
"web-worker":
|
|
127
|
+
false,
|
|
128
|
+
"yargs":
|
|
129
|
+
false,
|
|
130
|
+
"yargs/helpers":
|
|
131
|
+
false,
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
externals:
|
|
135
|
+
{ yargs:
|
|
136
|
+
'yargs' },
|
|
137
|
+
plugins: [
|
|
138
|
+
_node_fs_ignore_plugin,
|
|
139
|
+
_yargs_ignore_plugin,
|
|
140
|
+
_yargs_helpers_ignore_plugin
|
|
141
|
+
]
|
|
142
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={314(e,t,r){r.a(e,async(e,t)=>{try{(0,(await r.e(10).then(()=>r(10))).startSyncAgent)(),t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const c=t[o]={exports:{}};return e[o](c,c.exports,r),c.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,c,s)=>{let i;s&&((i=[]).d=-1);const a=new Set,l=r.exports;let u,p,d;const f=new Promise((e,t)=>{d=t,p=e});f[t]=l,f[e]=e=>(i&&e(i),a.forEach(e),f.catch(e=>{})),r.exports=f,c(r=>{let c;u=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[e])return r;if(r.then){const c=[];c.d=0,r.then(e=>{s[t]=e,n(c)},e=>{s[o]=e,n(c)});const s={};return s[e]=e=>e(c),s}}const c={};return c[e]=e=>{},c[t]=r,c}))(r);const s=()=>u.map(e=>{if(e[o])throw e[o];return e[t]}),l=new Promise(t=>{c=()=>t(s),c.r=0;const r=e=>e!==i&&!a.has(e)&&(a.add(e),e&&!e.d&&(c.r++,e.push(c)));u.forEach(t=>t[e](r))});return c.r?l:s()},e=>(e?d(f[o]=e):p(l),n(i))),i?.d<0&&(i.d=0)}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],c=t[o++],s=0===c?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:c};r.o(e,n)||Object.defineProperty(e,n,s)}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>{const t=[];return r.f.j(e,t),Promise.all(t)},r.u=e=>e+".fs-worker.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="libcoreutils:";r.l=(o,n,c,s)=>{if(e[o])return void e[o].push(n);let i,a;if(void 0!==c){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const r=e[l];if(r.getAttribute("src")==o||r.getAttribute("data-webpack")==t+c){i=r;break}}}i||(a=!0,i=document.createElement("script"),i.charset="utf-8",r.nc&&i.setAttribute("nonce",r.nc),i.setAttribute("data-webpack",t+c),i.src=o),e[o]=[n];const u=(t,r)=>{i.onerror=i.onload=null,clearTimeout(p);const n=e[o];if(delete e[o],i.parentNode?.removeChild(i),n?.forEach(e=>e(r)),t)return t(r)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),a&&document.head.appendChild(i)}})(),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;r.g.importScripts&&(e=r.g.location+"");const t=r.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const r=t.getElementsByTagName("script");if(r.length){let t=r.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=r[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),r.p=e})(),(()=>{const e={792:0};r.f.j=(t,o)=>{let n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{const c=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=c);const s=new Error,i=o=>{if(r.o(e,t)&&(n=e[t],0!==n&&(e[t]=void 0),n)){const e=o&&("load"===o.type?"missing":o.type),r=o&&o.target&&o.target.src;s.message="Loading chunk "+t+" failed.\n("+e+": "+r+")",s.name="ChunkLoadError",s.type=e,s.request=r,s.event=o,n[1](s)}};r.l(r.p+r.u(t),i,"chunk-"+t,t)}};const t=(t,o)=>{let[n,c,s]=o;var i,a,l=0;if(n.some(t=>0!==e[t])){for(i in c)r.o(c,i)&&(r.m[i]=c[i]);s&&s(r)}for(t&&t(o);l<n.length;l++)a=n[l],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0},o=self.webpackChunklibcoreutils=self.webpackChunklibcoreutils||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),r(314)})();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
---------------------------------------------
|
|
5
|
+
Copyright © 2024, 2025, 2026
|
|
6
|
+
Pellegrino Prevete
|
|
7
|
+
|
|
8
|
+
All rights reserved
|
|
9
|
+
---------------------------------------------
|
|
10
|
+
|
|
11
|
+
This program is free software: you can
|
|
12
|
+
redistribute it and/or modify it under the
|
|
13
|
+
terms of the GNU Affero General Public
|
|
14
|
+
License as published by the Free Software
|
|
15
|
+
Foundation, either version 3 of the License,
|
|
16
|
+
or (at your option) any later version.
|
|
17
|
+
|
|
18
|
+
This program is distributed in the hope that
|
|
19
|
+
it will be useful, but WITHOUT ANY WARRANTY;
|
|
20
|
+
without even the implied warranty of
|
|
21
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
22
|
+
PURPOSE. See the GNU Affero General Public
|
|
23
|
+
License for more details.
|
|
24
|
+
|
|
25
|
+
You should have received a copy of the GNU
|
|
26
|
+
Affero General Public License
|
|
27
|
+
along with this program.
|
|
28
|
+
If not, see <https://www.gnu.org/licenses/>.
|
|
29
|
+
-->
|
|
30
|
+
|
|
31
|
+
<script src="libcoreutils.js"></script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={477(e,t,r){r.a(e,async(e,t)=>{try{(await r.e(778).then(()=>r(778)))._base64,t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const c=t[o]={exports:{}};return e[o](c,c.exports,r),c.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,c,i)=>{let s;i&&((s=[]).d=-1);const a=new Set,l=r.exports;let u,f,p;const d=new Promise((e,t)=>{p=t,f=e});d[t]=l,d[e]=e=>(s&&e(s),a.forEach(e),d.catch(e=>{})),r.exports=d,c(r=>{let c;u=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[e])return r;if(r.then){const c=[];c.d=0,r.then(e=>{i[t]=e,n(c)},e=>{i[o]=e,n(c)});const i={};return i[e]=e=>e(c),i}}const c={};return c[e]=e=>{},c[t]=r,c}))(r);const i=()=>u.map(e=>{if(e[o])throw e[o];return e[t]}),l=new Promise(t=>{c=()=>t(i),c.r=0;const r=e=>e!==s&&!a.has(e)&&(a.add(e),e&&!e.d&&(c.r++,e.push(c)));u.forEach(t=>t[e](r))});return c.r?l:i()},e=>(e?p(d[o]=e):f(l),n(s))),s?.d<0&&(s.d=0)}})(),(()=>{const e=Object.getPrototypeOf;let t;r.t=function(o,n){if(1&n&&(o=this(o)),8&n)return o;if("object"==typeof o&&o){if(4&n&&o.__esModule)return o;if(16&n&&"function"==typeof o.then)return o}const c=Object.create(null);r.r(c);const i={};t=t||[null,e({}),e([]),e(e)];for(var s=2&n&&o;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>o[e]);return i.default=()=>o,r.d(c,i),c}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],c=t[o++],i=0===c?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:c};r.o(e,n)||Object.defineProperty(e,n,i)}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>{const t=[];return r.f.j(e,t),Promise.all(t)},r.u=e=>e+".libcoreutils.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="libcoreutils:";r.l=(o,n,c,i)=>{if(e[o])return void e[o].push(n);let s,a;if(void 0!==c){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const r=e[l];if(r.getAttribute("src")==o||r.getAttribute("data-webpack")==t+c){s=r;break}}}s||(a=!0,s=document.createElement("script"),s.charset="utf-8",r.nc&&s.setAttribute("nonce",r.nc),s.setAttribute("data-webpack",t+c),s.src=o),e[o]=[n];const u=(t,r)=>{s.onerror=s.onload=null,clearTimeout(f);const n=e[o];if(delete e[o],s.parentNode?.removeChild(s),n?.forEach(e=>e(r)),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),a&&document.head.appendChild(s)}})(),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;r.g.importScripts&&(e=r.g.location+"");const t=r.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const r=t.getElementsByTagName("script");if(r.length){let t=r.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=r[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),r.p=e})(),(()=>{const e={792:0};r.f.j=(t,o)=>{let n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{const c=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=c);const i=new Error,s=o=>{if(r.o(e,t)&&(n=e[t],0!==n&&(e[t]=void 0),n)){const e=o&&("load"===o.type?"missing":o.type),r=o&&o.target&&o.target.src;i.message="Loading chunk "+t+" failed.\n("+e+": "+r+")",i.name="ChunkLoadError",i.type=e,i.request=r,i.event=o,n[1](i)}};r.l(r.p+r.u(t),s,"chunk-"+t,t)}};const t=(t,o)=>{let[n,c,i]=o;var s,a,l=0;if(n.some(t=>0!==e[t])){for(s in c)r.o(c,s)&&(r.m[s]=c[s]);i&&i(r)}for(t&&t(o);l<n.length;l++)a=n[l],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0},o=self.webpackChunklibcoreutils=self.webpackChunklibcoreutils||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),r(477)})();
|
package/eslint.config.mjs
CHANGED
|
@@ -29,7 +29,7 @@ import { defineConfig } from "eslint/config";
|
|
|
29
29
|
|
|
30
30
|
const
|
|
31
31
|
_project =
|
|
32
|
-
"
|
|
32
|
+
"coreutils";
|
|
33
33
|
|
|
34
34
|
const
|
|
35
35
|
_ignores = [
|
|
@@ -39,7 +39,6 @@ const
|
|
|
39
39
|
"eslint.config.js",
|
|
40
40
|
"fs-worker.js",
|
|
41
41
|
"**/*.fs-worker.js",
|
|
42
|
-
`**/*.${_project}.js`,
|
|
43
42
|
`**/*.base64.js`,
|
|
44
43
|
`**/*.lib${_project}.js`,
|
|
45
44
|
`**/*.libbase64.js`,
|
|
@@ -57,7 +56,6 @@ export default defineConfig([
|
|
|
57
56
|
files:
|
|
58
57
|
[ "**/*.{js,mjs,cjs}",
|
|
59
58
|
`**/base64`,
|
|
60
|
-
`**/${_project}*`,
|
|
61
59
|
`**/libbase64`,
|
|
62
60
|
`**/lib${_project}`
|
|
63
61
|
],
|
package/libbase64
CHANGED
package/libcoreutils
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
|
|
5
|
+
/** ----------------------------------------------------------
|
|
6
|
+
* libcoreutils
|
|
7
|
+
* ----------------------------------------------------------
|
|
8
|
+
* Copyright ©
|
|
9
|
+
* Pellegrino Prevete
|
|
10
|
+
* 2024, 2025, 2026
|
|
11
|
+
*
|
|
12
|
+
* All rights reserved
|
|
13
|
+
* ----------------------------------------------------------
|
|
14
|
+
*
|
|
15
|
+
* This program is free software: you can redistribute it
|
|
16
|
+
* and/or modify it under the terms of the GNU General
|
|
17
|
+
* Public License as published by the Free Software
|
|
18
|
+
* Foundation, either version 3 of the License, or
|
|
19
|
+
* (at your option) any later version.
|
|
20
|
+
*
|
|
21
|
+
* This program is distributed in the hope that it will
|
|
22
|
+
* be useful, but WITHOUT ANY WARRANTY; without even the
|
|
23
|
+
* implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE.
|
|
25
|
+
* See the GNU General Public License for more details.
|
|
26
|
+
*
|
|
27
|
+
* You should have received a copy of the
|
|
28
|
+
* GNU General Public License
|
|
29
|
+
* along with this program.
|
|
30
|
+
* If not, see <https://www.gnu.org/licenses/>.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/* eslint-disable
|
|
34
|
+
no-unused-vars */
|
|
35
|
+
|
|
36
|
+
const
|
|
37
|
+
_libbase64 =
|
|
38
|
+
await import(
|
|
39
|
+
"./libbase64");
|
|
40
|
+
const
|
|
41
|
+
_base64 =
|
|
42
|
+
_libbase64._base64;
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
_base64
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// module.exports = {
|
|
49
|
+
// _base64:
|
|
50
|
+
// _base64
|
|
51
|
+
// };
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name":
|
|
3
3
|
"libcoreutils",
|
|
4
4
|
"version":
|
|
5
|
-
"0.0.
|
|
5
|
+
"0.0.24",
|
|
6
6
|
"description":
|
|
7
|
-
"Javascript implementations of some coreutils.",
|
|
7
|
+
"Javascript implementations of some GNU coreutils.",
|
|
8
8
|
"funding": {
|
|
9
9
|
"type":
|
|
10
10
|
"patreon",
|
|
@@ -12,19 +12,21 @@
|
|
|
12
12
|
"https://patreon.com/tallero"
|
|
13
13
|
},
|
|
14
14
|
"man":
|
|
15
|
-
"./man/
|
|
15
|
+
"./man/base64.js.1",
|
|
16
16
|
"files": [
|
|
17
17
|
"AUTHORS.rst",
|
|
18
18
|
"COPYING",
|
|
19
19
|
"README.md",
|
|
20
|
+
"base64",
|
|
21
|
+
"base64.webpack.config.cjs",
|
|
20
22
|
"dist",
|
|
21
23
|
"eslint.config.mjs",
|
|
22
24
|
"package.json",
|
|
23
|
-
"base64",
|
|
24
25
|
"fs-worker.webpack.config.cjs",
|
|
25
26
|
"serve.json",
|
|
26
27
|
"libbase64",
|
|
27
28
|
"libbase64.webpack.config.cjs",
|
|
29
|
+
"libcoreutils",
|
|
28
30
|
"webpack.config.cjs"
|
|
29
31
|
],
|
|
30
32
|
"keywords": [
|
|
@@ -102,12 +104,12 @@
|
|
|
102
104
|
"minimatch":
|
|
103
105
|
"^11.0.4",
|
|
104
106
|
"base64":
|
|
105
|
-
"./
|
|
107
|
+
"./libbase64"
|
|
106
108
|
},
|
|
107
109
|
"type":
|
|
108
110
|
"module",
|
|
109
111
|
"main":
|
|
110
|
-
"
|
|
112
|
+
"libcoreutils",
|
|
111
113
|
"bin":
|
|
112
114
|
{
|
|
113
115
|
"base64":
|
|
@@ -118,11 +120,17 @@
|
|
|
118
120
|
"./base64" },
|
|
119
121
|
"scripts": {
|
|
120
122
|
"build-fs-worker":
|
|
121
|
-
"npx webpack --mode 'production' --config 'fs-worker.webpack.config.cjs' --stats-error-details
|
|
122
|
-
"build-
|
|
123
|
+
"npx webpack --mode 'production' --config 'fs-worker.webpack.config.cjs' --stats-error-details; cp 'fs-worker.js' 'dist/libbase64'; cp 'fs-worker.js' 'dist/base64'; cp 'fs-worker.js' 'dist/libcoreutils'",
|
|
124
|
+
"build-libbase64":
|
|
123
125
|
"npx webpack --mode 'production' --config 'libbase64.webpack.config.cjs' --stats-error-details && cp 'libbase64.js' 'dist/libbase64'",
|
|
126
|
+
"build-lib":
|
|
127
|
+
"npm run build-libbase64; npm run build-libcoreutils",
|
|
128
|
+
"build-base64":
|
|
129
|
+
"npx webpack --mode 'production' --config 'base64.webpack.config.cjs' --stats-error-details && cp 'base64.js' 'dist/base64'",
|
|
130
|
+
"build-libcoreutils":
|
|
131
|
+
"npx webpack --mode 'production' --config 'webpack.config.cjs' --stats-error-details && cp 'libcoreutils.js' 'dist/libcoreutils'",
|
|
124
132
|
"build-bin":
|
|
125
|
-
"
|
|
133
|
+
"npm run build-base64",
|
|
126
134
|
"build":
|
|
127
135
|
"npm run build-fs-worker && npm run build-lib && npm run build-bin",
|
|
128
136
|
"lint":
|
|
@@ -130,7 +138,7 @@
|
|
|
130
138
|
"publish-npm":
|
|
131
139
|
"npm lint && npm run build && npm publish --access public",
|
|
132
140
|
"start":
|
|
133
|
-
"npx safely-serve 'dist/
|
|
141
|
+
"npx safely-serve 'dist/libcoreutils'",
|
|
134
142
|
"test":
|
|
135
143
|
"echo \"Error: no test specified\" && exit 1"
|
|
136
144
|
}
|
package/webpack.config.cjs
CHANGED
package/dist/base64/base64.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={559(e,t,n){n.a(e,async(e,t)=>{try{const o=await n.e(35).then(()=>n(35)),i=o._argv_url_get,r=o._cmdline_check,s=o._echo,u=o._exit,a=o._get,f=o._global_get,l=o._msg_info,c=o._msg_error,p=o._override_set,h=(o._require,o._set),m=o._yargv_get,d=(await n.e(778).then(()=>n(778)))._base64;function b(){p("app","name","tmcbase64"),p("app","opts",[]),p("runtime","environment",""),p("numeric","suffix",""),p("suffix","length",""),p("chunks","amount",""),p("size","max",""),p("input","file",""),p("output","prefix","");const e=f();e.quiet="",e.verbose=""}function g(){const e=a("input","file");p("suffix","length","base64"),p("output","prefix",e)}function _(){let e;const t=[`${app_name} configuration:`,` Runtime environment: ${runtime_environment}`,` Suffix length: ${suffix_length}`,` Maximum chunk size: ${size_max} bytes`,` Amount of chunks: ${chunks_amount}`,` In file: ${input_file}`,` Out files prefix: ${output_prefix}`];for(e of t)l(e)}function x(e){let t;const n=["Output pieces of FILE to PREFIXaa, PREFIXab, ...","default size is 1000 lines, and default PREFIX is 'x'.","","Usage:",""," tmcbase64"," <in-file>"," <out-txt-prefix>",""," arguments:"," <in-file> An input file."," <out-file-prefix> Prefix for the output"," file(s).",""," options:",""," -a, --suffix-length=N Generate suffixes of"," length N.",` Default: '${suffix_length}'`," --additional-suffix=SUFFIX append an additional SUFFIX"," to file names."," -b, --bytes=SIZE Put SIZE bytes per output"," file."," -C, --line-bytes=SIZE Put at most SIZE bytes of"," records per output file."," -d Use numeric suffixes"," starting at 0, not"," alphabetic."," --numeric-suffixes[=FROM] Same as -d, but allow"," setting the start value."," -l, --lines=NUMBER Put NUMBER lines/records"," per output file."," -n, --number=CHUNKS Generate CHUNKS output"," files; see explanation"," below"," -t, --separator=SEP Use SEP instead of newline"," as the record separator;"," '\0' (zero) specifies the"," NUL character.",""," -h --help This message."," -v --verbose Enable verbose output.","","The SIZE argument is an integer and optional","unit (example: 10K is 10*1024).","Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024)","or KB,MB,... (powers of 1000).","Binary prefixes can be used, too: KiB=K, MiB=M, and so on.","","CHUNKS may be:"," N split into N files based on size of input"," K/N output Kth of N to standard output"," l/N split into N files without splitting lines/records"," l/K/N output Kth of N to standard output without"," splitting lines/records"];for(t of n)s(t);u(e)}function y(e){(e.help||e.h)&&(quiet="n",x(0))}function v(e){e._.length<1&&(c("Input file argument required.",0),x(1))}async function w(){const e=await m();quiet="y",h("runtime","environment","node"),y(e),v(e),h("input","file",e._[0]),e._.length<2&&h("output","prefix",a("input","file")),"a"in e&&h("suffix","length",e.a),"suffix-length"in e&&h("suffix","length",e["suffix-length"]),"suffix-length"in e&&h("suffix","length",e["suffix-length"]),"d"in e&&h("numeric","suffix",!0),h("chunks","amount",e["chunks-amount"]||e.n),h("chunks","amount",e["size-max"]||e.b);const t=f();t.verbose=e.verbose||e.v,t.verbose&&(t.quiet="n")}function E(){const e=i();runtime_environment="browser",input_file=e.input_file[0],output_prefix=i.output_prefix[0],chunks_amount=i.chunks_amount[0],quiet=i.quiet,0===quiet.length&&(quiet="n")}b(),g(),r("tmcsplit")?await w():E(),_(),app_opts=[input_file,output_prefix,chunks_amount,size_max];try{d.apply(null,app_opts)}catch(k){c("Error running '_base64' arguments:",0),_echo2(_app_opts),_echo2(k),u(1)}t()}catch(S){t(S)}},1)}};const t={};function n(o){const i=t[o];if(void 0!==i)return i.exports;const r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),i=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(n,r,s)=>{let u;s&&((u=[]).d=-1);const a=new Set,f=n.exports;let l,c,p;const h=new Promise((e,t)=>{p=t,c=e});h[t]=f,h[e]=e=>(u&&e(u),a.forEach(e),h.catch(e=>{})),n.exports=h,r(n=>{let r;l=(n=>n.map(n=>{if(null!==n&&"object"==typeof n){if(n[e])return n;if(n.then){const r=[];r.d=0,n.then(e=>{s[t]=e,i(r)},e=>{s[o]=e,i(r)});const s={};return s[e]=e=>e(r),s}}const r={};return r[e]=e=>{},r[t]=n,r}))(n);const s=()=>l.map(e=>{if(e[o])throw e[o];return e[t]}),f=new Promise(t=>{r=()=>t(s),r.r=0;const n=e=>e!==u&&!a.has(e)&&(a.add(e),e&&!e.d&&(r.r++,e.push(r)));l.forEach(t=>t[e](n))});return r.r?f:s()},e=>(e?p(h[o]=e):c(f),i(u))),u?.d<0&&(u.d=0)}})(),(()=>{const e=Object.getPrototypeOf;let t;n.t=function(o,i){if(1&i&&(o=this(o)),8&i)return o;if("object"==typeof o&&o){if(4&i&&o.__esModule)return o;if(16&i&&"function"==typeof o.then)return o}const r=Object.create(null);n.r(r);const s={};t=t||[null,e({}),e([]),e(e)];for(var u=2&i&&o;("object"==typeof u||"function"==typeof u)&&!~t.indexOf(u);u=e(u))Object.getOwnPropertyNames(u).forEach(e=>s[e]=()=>o[e]);return s.default=()=>o,n.d(r,s),r}})(),n.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var i=t[o++],r=t[o++],s=0===r?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:r};n.o(e,i)||Object.defineProperty(e,i,s)}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.f={},n.e=e=>{const t=[];return n.f.j(e,t),Promise.all(t)},n.u=e=>e+".base64.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="libcoreutils:";n.l=(o,i,r,s)=>{if(e[o])return void e[o].push(i);let u,a;if(void 0!==r){const e=document.getElementsByTagName("script");for(var f=0;f<e.length;f++){const n=e[f];if(n.getAttribute("src")==o||n.getAttribute("data-webpack")==t+r){u=n;break}}}u||(a=!0,u=document.createElement("script"),u.charset="utf-8",n.nc&&u.setAttribute("nonce",n.nc),u.setAttribute("data-webpack",t+r),u.src=o),e[o]=[i];const l=(t,n)=>{u.onerror=u.onload=null,clearTimeout(c);const i=e[o];if(delete e[o],u.parentNode?.removeChild(u),i?.forEach(e=>e(n)),t)return t(n)},c=setTimeout(l.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=l.bind(null,u.onerror),u.onload=l.bind(null,u.onload),a&&document.head.appendChild(u)}})(),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;n.g.importScripts&&(e=n.g.location+"");const t=n.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const n=t.getElementsByTagName("script");if(n.length){let t=n.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=n[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),n.p=e})(),(()=>{const e={792:0};n.f.j=(t,o)=>{let i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)o.push(i[2]);else{const r=new Promise((n,o)=>i=e[t]=[n,o]);o.push(i[2]=r);const s=new Error,u=o=>{if(n.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){const e=o&&("load"===o.type?"missing":o.type),n=o&&o.target&&o.target.src;s.message="Loading chunk "+t+" failed.\n("+e+": "+n+")",s.name="ChunkLoadError",s.type=e,s.request=n,s.event=o,i[1](s)}};n.l(n.p+n.u(t),u,"chunk-"+t,t)}};const t=(t,o)=>{let[i,r,s]=o;var u,a,f=0;if(i.some(t=>0!==e[t])){for(u in r)n.o(r,u)&&(n.m[u]=r[u]);s&&s(n)}for(t&&t(o);f<i.length;f++)a=i[f],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},o=self.webpackChunklibcoreutils=self.webpackChunklibcoreutils||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),n(559)})();
|