@alienkarma/exceljs 4.4.0-fork.1 → 4.4.0-fork.11
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.
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
const Archiver = require('archiver');
|
|
1
|
+
import { ZipArchive } from "@alienkarma/archiver";
|
|
3
2
|
|
|
4
|
-
const
|
|
3
|
+
const fs = require("fs");
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
const StylesXform = require('../../xlsx/xform/style/styles-xform');
|
|
8
|
-
const SharedStrings = require('../../utils/shared-strings');
|
|
9
|
-
const DefinedNames = require('../../doc/defined-names');
|
|
5
|
+
const StreamBuf = require("../../utils/stream-buf");
|
|
10
6
|
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const WorkbookXform = require('../../xlsx/xform/book/workbook-xform');
|
|
16
|
-
const SharedStringsXform = require('../../xlsx/xform/strings/shared-strings-xform');
|
|
7
|
+
const RelType = require("../../xlsx/rel-type");
|
|
8
|
+
const StylesXform = require("../../xlsx/xform/style/styles-xform");
|
|
9
|
+
const SharedStrings = require("../../utils/shared-strings");
|
|
10
|
+
const DefinedNames = require("../../doc/defined-names");
|
|
17
11
|
|
|
18
|
-
const
|
|
12
|
+
const CoreXform = require("../../xlsx/xform/core/core-xform");
|
|
13
|
+
const RelationshipsXform = require("../../xlsx/xform/core/relationships-xform");
|
|
14
|
+
const ContentTypesXform = require("../../xlsx/xform/core/content-types-xform");
|
|
15
|
+
const AppXform = require("../../xlsx/xform/core/app-xform");
|
|
16
|
+
const WorkbookXform = require("../../xlsx/xform/book/workbook-xform");
|
|
17
|
+
const SharedStringsXform = require("../../xlsx/xform/strings/shared-strings-xform");
|
|
19
18
|
|
|
20
|
-
const
|
|
19
|
+
const WorksheetWriter = require("./worksheet-writer");
|
|
20
|
+
|
|
21
|
+
const theme1Xml = require("../../xlsx/xml/theme1.js");
|
|
21
22
|
|
|
22
23
|
class WorkbookWriter {
|
|
23
24
|
constructor(options) {
|
|
@@ -25,8 +26,8 @@ class WorkbookWriter {
|
|
|
25
26
|
|
|
26
27
|
this.created = options.created || new Date();
|
|
27
28
|
this.modified = options.modified || this.created;
|
|
28
|
-
this.creator = options.creator ||
|
|
29
|
-
this.lastModifiedBy = options.lastModifiedBy ||
|
|
29
|
+
this.creator = options.creator || "ExcelJS";
|
|
30
|
+
this.lastModifiedBy = options.lastModifiedBy || "ExcelJS";
|
|
30
31
|
this.lastPrinted = options.lastPrinted;
|
|
31
32
|
|
|
32
33
|
// using shared strings creates a smaller xlsx file but may use more memory
|
|
@@ -34,7 +35,9 @@ class WorkbookWriter {
|
|
|
34
35
|
this.sharedStrings = new SharedStrings();
|
|
35
36
|
|
|
36
37
|
// style manager
|
|
37
|
-
this.styles = options.useStyles
|
|
38
|
+
this.styles = options.useStyles
|
|
39
|
+
? new StylesXform(true)
|
|
40
|
+
: new StylesXform.Mock(true);
|
|
38
41
|
|
|
39
42
|
// defined names
|
|
40
43
|
this._definedNames = new DefinedNames();
|
|
@@ -47,7 +50,7 @@ class WorkbookWriter {
|
|
|
47
50
|
this.media = [];
|
|
48
51
|
this.commentRefs = [];
|
|
49
52
|
|
|
50
|
-
this.zip =
|
|
53
|
+
this.zip = new ZipArchive(this.zipOptions);
|
|
51
54
|
if (options.stream) {
|
|
52
55
|
this.stream = options.stream;
|
|
53
56
|
} else if (options.filename) {
|
|
@@ -66,19 +69,19 @@ class WorkbookWriter {
|
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
_openStream(path) {
|
|
69
|
-
const stream = new StreamBuf({bufSize: 65536, batch: true});
|
|
70
|
-
this.zip.append(stream, {name: path});
|
|
71
|
-
stream.on(
|
|
72
|
-
stream.emit(
|
|
72
|
+
const stream = new StreamBuf({ bufSize: 65536, batch: true });
|
|
73
|
+
this.zip.append(stream, { name: path });
|
|
74
|
+
stream.on("finish", () => {
|
|
75
|
+
stream.emit("zipped");
|
|
73
76
|
});
|
|
74
77
|
return stream;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
_commitWorksheets() {
|
|
78
|
-
const commitWorksheet = function(worksheet) {
|
|
81
|
+
const commitWorksheet = function (worksheet) {
|
|
79
82
|
if (!worksheet.committed) {
|
|
80
|
-
return new Promise(resolve => {
|
|
81
|
-
worksheet.stream.on(
|
|
83
|
+
return new Promise((resolve) => {
|
|
84
|
+
worksheet.stream.on("zipped", () => {
|
|
82
85
|
resolve();
|
|
83
86
|
});
|
|
84
87
|
worksheet.commit();
|
|
@@ -124,7 +127,10 @@ class WorkbookWriter {
|
|
|
124
127
|
|
|
125
128
|
addImage(image) {
|
|
126
129
|
const id = this.media.length;
|
|
127
|
-
const medium = Object.assign({}, image, {
|
|
130
|
+
const medium = Object.assign({}, image, {
|
|
131
|
+
type: "image",
|
|
132
|
+
name: `image${id}.${image.extension}`,
|
|
133
|
+
});
|
|
128
134
|
this.media.push(medium);
|
|
129
135
|
return id;
|
|
130
136
|
}
|
|
@@ -139,16 +145,20 @@ class WorkbookWriter {
|
|
|
139
145
|
// in fact, it's even possible to switch it mid-sheet
|
|
140
146
|
options = options || {};
|
|
141
147
|
const useSharedStrings =
|
|
142
|
-
options.useSharedStrings !== undefined
|
|
148
|
+
options.useSharedStrings !== undefined
|
|
149
|
+
? options.useSharedStrings
|
|
150
|
+
: this.useSharedStrings;
|
|
143
151
|
|
|
144
152
|
if (options.tabColor) {
|
|
145
153
|
// eslint-disable-next-line no-console
|
|
146
|
-
console.trace(
|
|
154
|
+
console.trace(
|
|
155
|
+
"tabColor option has moved to { properties: tabColor: {...} }",
|
|
156
|
+
);
|
|
147
157
|
options.properties = Object.assign(
|
|
148
158
|
{
|
|
149
159
|
tabColor: options.tabColor,
|
|
150
160
|
},
|
|
151
|
-
options.properties
|
|
161
|
+
options.properties,
|
|
152
162
|
);
|
|
153
163
|
}
|
|
154
164
|
|
|
@@ -176,44 +186,54 @@ class WorkbookWriter {
|
|
|
176
186
|
if (id === undefined) {
|
|
177
187
|
return this._worksheets.find(() => true);
|
|
178
188
|
}
|
|
179
|
-
if (typeof id ===
|
|
189
|
+
if (typeof id === "number") {
|
|
180
190
|
return this._worksheets[id];
|
|
181
191
|
}
|
|
182
|
-
if (typeof id ===
|
|
183
|
-
return this._worksheets.find(
|
|
192
|
+
if (typeof id === "string") {
|
|
193
|
+
return this._worksheets.find(
|
|
194
|
+
(worksheet) => worksheet && worksheet.name === id,
|
|
195
|
+
);
|
|
184
196
|
}
|
|
185
197
|
return undefined;
|
|
186
198
|
}
|
|
187
199
|
|
|
188
200
|
addStyles() {
|
|
189
|
-
return new Promise(resolve => {
|
|
190
|
-
this.zip.append(this.styles.xml, {name:
|
|
201
|
+
return new Promise((resolve) => {
|
|
202
|
+
this.zip.append(this.styles.xml, { name: "xl/styles.xml" });
|
|
191
203
|
resolve();
|
|
192
204
|
});
|
|
193
205
|
}
|
|
194
206
|
|
|
195
207
|
addThemes() {
|
|
196
|
-
return new Promise(resolve => {
|
|
197
|
-
this.zip.append(theme1Xml, {name:
|
|
208
|
+
return new Promise((resolve) => {
|
|
209
|
+
this.zip.append(theme1Xml, { name: "xl/theme/theme1.xml" });
|
|
198
210
|
resolve();
|
|
199
211
|
});
|
|
200
212
|
}
|
|
201
213
|
|
|
202
214
|
addOfficeRels() {
|
|
203
|
-
return new Promise(resolve => {
|
|
215
|
+
return new Promise((resolve) => {
|
|
204
216
|
const xform = new RelationshipsXform();
|
|
205
217
|
const xml = xform.toXml([
|
|
206
|
-
{Id:
|
|
207
|
-
{
|
|
208
|
-
|
|
218
|
+
{ Id: "rId1", Type: RelType.OfficeDocument, Target: "xl/workbook.xml" },
|
|
219
|
+
{
|
|
220
|
+
Id: "rId2",
|
|
221
|
+
Type: RelType.CoreProperties,
|
|
222
|
+
Target: "docProps/core.xml",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
Id: "rId3",
|
|
226
|
+
Type: RelType.ExtenderProperties,
|
|
227
|
+
Target: "docProps/app.xml",
|
|
228
|
+
},
|
|
209
229
|
]);
|
|
210
|
-
this.zip.append(xml, {name:
|
|
230
|
+
this.zip.append(xml, { name: "/_rels/.rels" });
|
|
211
231
|
resolve();
|
|
212
232
|
});
|
|
213
233
|
}
|
|
214
234
|
|
|
215
235
|
addContentTypes() {
|
|
216
|
-
return new Promise(resolve => {
|
|
236
|
+
return new Promise((resolve) => {
|
|
217
237
|
const model = {
|
|
218
238
|
worksheets: this._worksheets.filter(Boolean),
|
|
219
239
|
sharedStrings: this.sharedStrings,
|
|
@@ -222,60 +242,60 @@ class WorkbookWriter {
|
|
|
222
242
|
};
|
|
223
243
|
const xform = new ContentTypesXform();
|
|
224
244
|
const xml = xform.toXml(model);
|
|
225
|
-
this.zip.append(xml, {name:
|
|
245
|
+
this.zip.append(xml, { name: "[Content_Types].xml" });
|
|
226
246
|
resolve();
|
|
227
247
|
});
|
|
228
248
|
}
|
|
229
249
|
|
|
230
250
|
addMedia() {
|
|
231
251
|
return Promise.all(
|
|
232
|
-
this.media.map(medium => {
|
|
233
|
-
if (medium.type ===
|
|
252
|
+
this.media.map((medium) => {
|
|
253
|
+
if (medium.type === "image") {
|
|
234
254
|
const filename = `xl/media/${medium.name}`;
|
|
235
255
|
if (medium.filename) {
|
|
236
|
-
return this.zip.file(medium.filename, {name: filename});
|
|
256
|
+
return this.zip.file(medium.filename, { name: filename });
|
|
237
257
|
}
|
|
238
258
|
if (medium.buffer) {
|
|
239
|
-
return this.zip.append(medium.buffer, {name: filename});
|
|
259
|
+
return this.zip.append(medium.buffer, { name: filename });
|
|
240
260
|
}
|
|
241
261
|
if (medium.base64) {
|
|
242
262
|
const dataimg64 = medium.base64;
|
|
243
|
-
const content = dataimg64.substring(dataimg64.indexOf(
|
|
244
|
-
return this.zip.append(content, {name: filename, base64: true});
|
|
263
|
+
const content = dataimg64.substring(dataimg64.indexOf(",") + 1);
|
|
264
|
+
return this.zip.append(content, { name: filename, base64: true });
|
|
245
265
|
}
|
|
246
266
|
}
|
|
247
|
-
throw new Error(
|
|
248
|
-
})
|
|
267
|
+
throw new Error("Unsupported media");
|
|
268
|
+
}),
|
|
249
269
|
);
|
|
250
270
|
}
|
|
251
271
|
|
|
252
272
|
addApp() {
|
|
253
|
-
return new Promise(resolve => {
|
|
273
|
+
return new Promise((resolve) => {
|
|
254
274
|
const model = {
|
|
255
275
|
worksheets: this._worksheets.filter(Boolean),
|
|
256
276
|
};
|
|
257
277
|
const xform = new AppXform();
|
|
258
278
|
const xml = xform.toXml(model);
|
|
259
|
-
this.zip.append(xml, {name:
|
|
279
|
+
this.zip.append(xml, { name: "docProps/app.xml" });
|
|
260
280
|
resolve();
|
|
261
281
|
});
|
|
262
282
|
}
|
|
263
283
|
|
|
264
284
|
addCore() {
|
|
265
|
-
return new Promise(resolve => {
|
|
285
|
+
return new Promise((resolve) => {
|
|
266
286
|
const coreXform = new CoreXform();
|
|
267
287
|
const xml = coreXform.toXml(this);
|
|
268
|
-
this.zip.append(xml, {name:
|
|
288
|
+
this.zip.append(xml, { name: "docProps/core.xml" });
|
|
269
289
|
resolve();
|
|
270
290
|
});
|
|
271
291
|
}
|
|
272
292
|
|
|
273
293
|
addSharedStrings() {
|
|
274
294
|
if (this.sharedStrings.count) {
|
|
275
|
-
return new Promise(resolve => {
|
|
295
|
+
return new Promise((resolve) => {
|
|
276
296
|
const sharedStringsXform = new SharedStringsXform();
|
|
277
297
|
const xml = sharedStringsXform.toXml(this.sharedStrings);
|
|
278
|
-
this.zip.append(xml, {name:
|
|
298
|
+
this.zip.append(xml, { name: "/xl/sharedStrings.xml" });
|
|
279
299
|
resolve();
|
|
280
300
|
});
|
|
281
301
|
}
|
|
@@ -285,17 +305,17 @@ class WorkbookWriter {
|
|
|
285
305
|
addWorkbookRels() {
|
|
286
306
|
let count = 1;
|
|
287
307
|
const relationships = [
|
|
288
|
-
{Id: `rId${count++}`, Type: RelType.Styles, Target:
|
|
289
|
-
{Id: `rId${count++}`, Type: RelType.Theme, Target:
|
|
308
|
+
{ Id: `rId${count++}`, Type: RelType.Styles, Target: "styles.xml" },
|
|
309
|
+
{ Id: `rId${count++}`, Type: RelType.Theme, Target: "theme/theme1.xml" },
|
|
290
310
|
];
|
|
291
311
|
if (this.sharedStrings.count) {
|
|
292
312
|
relationships.push({
|
|
293
313
|
Id: `rId${count++}`,
|
|
294
314
|
Type: RelType.SharedStrings,
|
|
295
|
-
Target:
|
|
315
|
+
Target: "sharedStrings.xml",
|
|
296
316
|
});
|
|
297
317
|
}
|
|
298
|
-
this._worksheets.forEach(worksheet => {
|
|
318
|
+
this._worksheets.forEach((worksheet) => {
|
|
299
319
|
if (worksheet) {
|
|
300
320
|
worksheet.rId = `rId${count++}`;
|
|
301
321
|
relationships.push({
|
|
@@ -305,16 +325,16 @@ class WorkbookWriter {
|
|
|
305
325
|
});
|
|
306
326
|
}
|
|
307
327
|
});
|
|
308
|
-
return new Promise(resolve => {
|
|
328
|
+
return new Promise((resolve) => {
|
|
309
329
|
const xform = new RelationshipsXform();
|
|
310
330
|
const xml = xform.toXml(relationships);
|
|
311
|
-
this.zip.append(xml, {name:
|
|
331
|
+
this.zip.append(xml, { name: "/xl/_rels/workbook.xml.rels" });
|
|
312
332
|
resolve();
|
|
313
333
|
});
|
|
314
334
|
}
|
|
315
335
|
|
|
316
336
|
addWorkbook() {
|
|
317
|
-
const {zip} = this;
|
|
337
|
+
const { zip } = this;
|
|
318
338
|
const model = {
|
|
319
339
|
worksheets: this._worksheets.filter(Boolean),
|
|
320
340
|
definedNames: this._definedNames.model,
|
|
@@ -323,21 +343,21 @@ class WorkbookWriter {
|
|
|
323
343
|
calcProperties: {},
|
|
324
344
|
};
|
|
325
345
|
|
|
326
|
-
return new Promise(resolve => {
|
|
346
|
+
return new Promise((resolve) => {
|
|
327
347
|
const xform = new WorkbookXform();
|
|
328
348
|
xform.prepare(model);
|
|
329
|
-
zip.append(xform.toXml(model), {name:
|
|
349
|
+
zip.append(xform.toXml(model), { name: "/xl/workbook.xml" });
|
|
330
350
|
resolve();
|
|
331
351
|
});
|
|
332
352
|
}
|
|
333
353
|
|
|
334
354
|
_finalize() {
|
|
335
355
|
return new Promise((resolve, reject) => {
|
|
336
|
-
this.stream.on(
|
|
337
|
-
this.stream.on(
|
|
356
|
+
this.stream.on("error", reject);
|
|
357
|
+
this.stream.on("finish", () => {
|
|
338
358
|
resolve(this);
|
|
339
359
|
});
|
|
340
|
-
this.zip.on(
|
|
360
|
+
this.zip.on("error", reject);
|
|
341
361
|
|
|
342
362
|
this.zip.finalize();
|
|
343
363
|
});
|
package/package.json
CHANGED
|
@@ -1,149 +1,151 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@alienkarma/exceljs",
|
|
3
|
-
"version": "4.4.0-fork.
|
|
4
|
-
"description": "Excel Workbook Manager - Read and Write xlsx and csv Files.",
|
|
5
|
-
"private": false,
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"index.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"test
|
|
34
|
-
"test:
|
|
35
|
-
"test:
|
|
36
|
-
"test:
|
|
37
|
-
"test:
|
|
38
|
-
"test:
|
|
39
|
-
"test:
|
|
40
|
-
"test:
|
|
41
|
-
"test:
|
|
42
|
-
"test:
|
|
43
|
-
"test:
|
|
44
|
-
"test:
|
|
45
|
-
"test:
|
|
46
|
-
"test:
|
|
47
|
-
"test:
|
|
48
|
-
"test:
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"lint
|
|
52
|
-
"lint:
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"benchmark
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"eslint --
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"@babel/
|
|
113
|
-
"@
|
|
114
|
-
"@
|
|
115
|
-
"@types/
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"chai
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"eslint
|
|
126
|
-
"eslint-
|
|
127
|
-
"eslint-
|
|
128
|
-
"eslint-
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"grunt
|
|
134
|
-
"grunt-
|
|
135
|
-
"grunt-
|
|
136
|
-
"grunt-contrib-
|
|
137
|
-
"grunt-
|
|
138
|
-
"grunt-
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@alienkarma/exceljs",
|
|
3
|
+
"version": "4.4.0-fork.11",
|
|
4
|
+
"description": "Excel Workbook Manager - Read and Write xlsx and csv Files.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Guyon Roche",
|
|
10
|
+
"email": "guyon@live.com"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/exceljs/exceljs.git"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=8.3.0"
|
|
18
|
+
},
|
|
19
|
+
"main": "./excel.js",
|
|
20
|
+
"browser": "./dist/exceljs.min.js",
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"lib",
|
|
25
|
+
"excel.js",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"README.md",
|
|
28
|
+
"README_zh.md",
|
|
29
|
+
"index.ts",
|
|
30
|
+
"index.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"test": "npm run test:full",
|
|
34
|
+
"test:es5": "export EXCEL_BUILD=es5 && npm run test:full",
|
|
35
|
+
"test:full": "npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:jasmine",
|
|
36
|
+
"test:version": "npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:browser && npm run test:dist",
|
|
37
|
+
"test:all": "npm run test:native && npm run test:es5",
|
|
38
|
+
"test:native": "npm run test:full",
|
|
39
|
+
"test:unit": "mocha --require spec/config/setup --require spec/config/setup-unit spec/unit --recursive",
|
|
40
|
+
"test:integration": "mocha --require spec/config/setup spec/integration --recursive",
|
|
41
|
+
"test:end-to-end": "mocha --require spec/config/setup spec/end-to-end --recursive",
|
|
42
|
+
"test:browser": "if [ ! -f .disable-test-browser ]; then npm run build && npm run test:jasmine; fi",
|
|
43
|
+
"test:jasmine": "grunt jasmine",
|
|
44
|
+
"test:unit:es5": "export EXCEL_BUILD=es5 && npm run test:unit",
|
|
45
|
+
"test:integration:es5": "export EXCEL_BUILD=es5 && npm run test:integration",
|
|
46
|
+
"test:end-to-end:es5": "export EXCEL_BUILD=es5 && npm run test:end-to-end",
|
|
47
|
+
"test:dist": "mocha --require spec/config/setup spec/dist --recursive",
|
|
48
|
+
"test:manual": "node spec/manual/app.js",
|
|
49
|
+
"test:typescript": "mocha -r ts-node/register spec/typescript/**/*.spec.ts",
|
|
50
|
+
"clean-build": "npm run clean && npm run build",
|
|
51
|
+
"lint": "eslint --format node_modules/eslint-friendly-formatter .",
|
|
52
|
+
"lint:fix": "prettier-eslint --write $(pwd)'/**/*.js'",
|
|
53
|
+
"lint:staged": "lint-staged",
|
|
54
|
+
"clean": "rm -rf build/ && rm -rf dist",
|
|
55
|
+
"benchmark": "node --expose-gc benchmark",
|
|
56
|
+
"benchmark:debug": "node --expose-gc --inspect-brk --trace-deopt benchmark",
|
|
57
|
+
"build": "grunt build",
|
|
58
|
+
"install-build": "npm install && grunt build",
|
|
59
|
+
"preversion": "npm run clean && npm run build && npm run test:version",
|
|
60
|
+
"postversion": "git push --no-verify && git push --tags --no-verify"
|
|
61
|
+
},
|
|
62
|
+
"husky": {
|
|
63
|
+
"hooks": {
|
|
64
|
+
"pre-commit": "lint-staged"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"lint-staged": {
|
|
68
|
+
"*.js": [
|
|
69
|
+
"prettier-eslint --write",
|
|
70
|
+
"eslint --format node_modules/eslint-friendly-formatter",
|
|
71
|
+
"git add"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"keywords": [
|
|
75
|
+
"xlsx",
|
|
76
|
+
"json",
|
|
77
|
+
"csv",
|
|
78
|
+
"excel",
|
|
79
|
+
"font",
|
|
80
|
+
"border",
|
|
81
|
+
"fill",
|
|
82
|
+
"number",
|
|
83
|
+
"format",
|
|
84
|
+
"number format",
|
|
85
|
+
"alignment",
|
|
86
|
+
"office",
|
|
87
|
+
"spreadsheet",
|
|
88
|
+
"workbook",
|
|
89
|
+
"defined names",
|
|
90
|
+
"data validations",
|
|
91
|
+
"rich text",
|
|
92
|
+
"in-cell format",
|
|
93
|
+
"outlineLevel",
|
|
94
|
+
"views",
|
|
95
|
+
"frozen",
|
|
96
|
+
"split",
|
|
97
|
+
"pageSetup"
|
|
98
|
+
],
|
|
99
|
+
"dependencies": {
|
|
100
|
+
"@alienkarma/archiver": "^7.0.1-fork.3",
|
|
101
|
+
"brace-expansion": "^2.0.2",
|
|
102
|
+
"dayjs": "^1.8.34",
|
|
103
|
+
"fast-csv": "^4.3.1",
|
|
104
|
+
"jszip": "^3.10.1",
|
|
105
|
+
"readable-stream": "^3.6.0",
|
|
106
|
+
"saxes": "^5.0.1",
|
|
107
|
+
"tmp": "^0.2.4",
|
|
108
|
+
"unzipper": "^0.12.3",
|
|
109
|
+
"uuid": "^8.3.0"
|
|
110
|
+
},
|
|
111
|
+
"devDependencies": {
|
|
112
|
+
"@babel/cli": "^7.10.5",
|
|
113
|
+
"@babel/core": "^7.11.4",
|
|
114
|
+
"@babel/preset-env": "^7.11.0",
|
|
115
|
+
"@types/chai": "^4.2.12",
|
|
116
|
+
"@types/mocha": "^8.0.3",
|
|
117
|
+
"@types/node": "^14.11.2",
|
|
118
|
+
"babelify": "^10.0.0",
|
|
119
|
+
"browserify": "^16.5.2",
|
|
120
|
+
"chai": "^4.2.0",
|
|
121
|
+
"chai-datetime": "^1.7.0",
|
|
122
|
+
"chai-xml": "^0.3.2",
|
|
123
|
+
"core-js": "^3.6.5",
|
|
124
|
+
"dirty-chai": "^2.0.1",
|
|
125
|
+
"eslint": "^6.5.1",
|
|
126
|
+
"eslint-config-airbnb-base": "^14.2.0",
|
|
127
|
+
"eslint-config-prettier": "^6.12.0",
|
|
128
|
+
"eslint-friendly-formatter": "^4.0.1",
|
|
129
|
+
"eslint-plugin-import": "^2.22.0",
|
|
130
|
+
"eslint-plugin-node": "^11.1.0",
|
|
131
|
+
"express": "^4.16.4",
|
|
132
|
+
"got": "^9.0.0",
|
|
133
|
+
"grunt": "^1.3.0",
|
|
134
|
+
"grunt-babel": "^8.0.0",
|
|
135
|
+
"grunt-browserify": "^5.3.0",
|
|
136
|
+
"grunt-contrib-copy": "^1.0.0",
|
|
137
|
+
"grunt-contrib-jasmine": "^2.2.0",
|
|
138
|
+
"grunt-contrib-watch": "^1.1.0",
|
|
139
|
+
"grunt-exorcise": "^2.1.1",
|
|
140
|
+
"grunt-terser": "^1.0.0",
|
|
141
|
+
"husky": "^4.3.0",
|
|
142
|
+
"lint-staged": "^10.2.13",
|
|
143
|
+
"mocha": "^7.2.0",
|
|
144
|
+
"prettier-eslint": "^11.0.0",
|
|
145
|
+
"prettier-eslint-cli": "^5.0.0",
|
|
146
|
+
"regenerator-runtime": "^0.13.7",
|
|
147
|
+
"sax": "^1.2.4",
|
|
148
|
+
"ts-node": "^8.10.2",
|
|
149
|
+
"typescript": "^3.9.7"
|
|
150
|
+
}
|
|
151
|
+
}
|