cbyte 1.10.0 → 1.11.0
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/99367107.cbyte +34 -0
- package/cbyte.js +13 -1
- package/package.json +1 -1
package/99367107.cbyte
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "cbyte",
|
|
3
|
+
"version": 1.1,
|
|
4
|
+
"chunk_size": 4096,
|
|
5
|
+
"original_size": 16552,
|
|
6
|
+
"original_ext": ".pdf",
|
|
7
|
+
"chunks": [
|
|
8
|
+
{
|
|
9
|
+
"cid": "bafkreiacqklbx4vdykcehffxqqutkogrecieqmg7inhpb3ipd76bbjlzgm",
|
|
10
|
+
"length": 4096,
|
|
11
|
+
"count": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"cid": "bafkreiawx6r5puro2aw4rv7n44w34pk4givaagjxsykzn327v2623oj6sm",
|
|
15
|
+
"length": 4096,
|
|
16
|
+
"count": 1
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"cid": "bafkreiara7il76jrtiyizb3z6hd2tcjn5ohqyhlwxff5gid3crgsqet4ya",
|
|
20
|
+
"length": 4096,
|
|
21
|
+
"count": 1
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"cid": "bafkreia3e4vp7hmirxgaj37bmyjthwf45yvgyysown3egoce3sjsqagmqu",
|
|
25
|
+
"length": 4096,
|
|
26
|
+
"count": 1
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"cid": "bafkreiaxfpoxjvvjwr2g2qnlhq63eqynh3nufsm2vxcdmudokdbr4z3hom",
|
|
30
|
+
"length": 168,
|
|
31
|
+
"count": 1
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
package/cbyte.js
CHANGED
|
@@ -17,6 +17,18 @@ evt.defaultMaxListeners = 6000;
|
|
|
17
17
|
const program = new Command();
|
|
18
18
|
let helia = null;
|
|
19
19
|
|
|
20
|
+
// ---- Promise.withResolvers polyfill (Node < 22) ----
|
|
21
|
+
if (typeof Promise.withResolvers !== 'function') {
|
|
22
|
+
Promise.withResolvers = function () {
|
|
23
|
+
let resolve, reject
|
|
24
|
+
const promise = new Promise((res, rej) => {
|
|
25
|
+
resolve = res
|
|
26
|
+
reject = rej
|
|
27
|
+
})
|
|
28
|
+
return { promise, resolve, reject }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
20
32
|
// Initialize Helia node once
|
|
21
33
|
async function ensureHelia() {
|
|
22
34
|
if (!helia) {
|
|
@@ -55,7 +67,7 @@ async function pack(filePath, outFile, chunkSize = 4096, pin = false) {
|
|
|
55
67
|
|
|
56
68
|
const manifest = {
|
|
57
69
|
format: 'cbyte',
|
|
58
|
-
version: 1.
|
|
70
|
+
version: 1.11,
|
|
59
71
|
chunk_size: chunkSize,
|
|
60
72
|
original_size: data.length,
|
|
61
73
|
original_ext: path.extname(filePath),
|