@ezs/basics 2.4.1 → 2.5.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/CHANGELOG.md +11 -0
- package/README.md +2 -1
- package/lib/tar-dump.js +6 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.5.0](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@2.4.1...@ezs/basics@2.5.0) (2023-08-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* 🎸 support text files ([2ba8571](https://github.com/Inist-CNRS/ezs/commit/2ba8571dbd651849ab12c4c08627ff29019e3c7f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.4.1](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@2.4.0...@ezs/basics@2.4.1) (2023-07-20)
|
|
7
18
|
|
|
8
19
|
|
package/README.md
CHANGED
|
@@ -551,7 +551,8 @@ Take all recevied objects and build a tar file
|
|
|
551
551
|
|
|
552
552
|
- `manifest` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Location path to store files in the tarball
|
|
553
553
|
- `location` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Location path to store files in the tarball (optional, default `data`)
|
|
554
|
-
- `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
554
|
+
- `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Convert to JSON the content of each chunk (optional, default `true`)
|
|
555
|
+
- `extension` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Choose extension fo each file (optional, default `json`)
|
|
555
556
|
- `compress` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Enable gzip compression (optional, default `false`)
|
|
556
557
|
|
|
557
558
|
### TARExtract
|
package/lib/tar-dump.js
CHANGED
|
@@ -25,7 +25,8 @@ const eol = '\n';
|
|
|
25
25
|
* @name TARDump
|
|
26
26
|
* @param {String} [manifest] Location path to store files in the tarball
|
|
27
27
|
* @param {String} [location=data] Location path to store files in the tarball
|
|
28
|
-
* @param {String} [json=true]
|
|
28
|
+
* @param {String} [json=true] Convert to JSON the content of each chunk
|
|
29
|
+
* @param {String} [extension=json] Choose extension fo each file
|
|
29
30
|
* @param {Boolean} [compress=false] Enable gzip compression
|
|
30
31
|
*/
|
|
31
32
|
|
|
@@ -55,11 +56,13 @@ function TARDump(data, feed) {
|
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
const json = this.getParam('json', true);
|
|
60
|
+
const extension = this.getParam('extension', 'json');
|
|
58
61
|
const id = this.getIndex().toString().padStart(10, '0');
|
|
59
|
-
const value = JSON.stringify(data).concat(eol);
|
|
62
|
+
const value = json ? JSON.stringify(data).concat(eol) : data;
|
|
60
63
|
const location = this.getParam('location', 'data');
|
|
61
64
|
this.pack.entry({
|
|
62
|
-
name: `${location}/f${id}
|
|
65
|
+
name: `${location}/f${id}.${extension}`
|
|
63
66
|
}, value);
|
|
64
67
|
feed.end();
|
|
65
68
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezs/basics",
|
|
3
3
|
"description": "Basics statements for EZS",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"author": "Nicolas Thouvenin <nthouvenin@gmail.com>",
|
|
6
6
|
"bugs": "https://github.com/Inist-CNRS/ezs/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"directories": {
|
|
43
43
|
"test": "test"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "c2694cd502cc4daaf7b9faa74eca46f7893771d8",
|
|
46
46
|
"homepage": "https://github.com/Inist-CNRS/ezs/tree/master/packages/basics#readme",
|
|
47
47
|
"keywords": [
|
|
48
48
|
"ezs"
|