-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
47 lines (44 loc) · 1.6 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const FastXlsxReader = require("./lib/FastXlsxReader");
exports = module.exports = FastXlsxReader;
/**
* Read sequentially the rows contained in an Excel sheet.
* @param {{
input: string,
output?: string|WriteStream|null,
format?: string,
sheetname?: string|number,
hasHeader?: boolean,
headerPrefix?: string,
lowerCaseHeaders?: boolean,
schema?: object,
onHeader?: (header: string[]) => void,
onCell?: (cell, rowIndex: number, colIndex: number) => void,
onRecord?: (record: any[], index: number) => void,
onFinish?: (items: any[], rowsProcessed: number) => void,
onError?: (err) => void,
useMemoryForItems?: boolean,
backwards?: boolean
}} options An object containing processing instructions.
*/
exports.read = options => new FastXlsxReader(options).read();
/**
* Create and return an instance of the FastXlsxSheetReader class.
* @param {{
input: string,
output?: string|WriteStream|null,
format?: string,
sheetname?: string|number,
hasHeader?: boolean,
headerPrefix?: string,
lowerCaseHeaders?: boolean,
schema?: object,
onHeader?: (header: string[]) => void,
onCell?: (cell, rowIndex: number, colIndex: number) => void,
onRecord?: (record: any[], index: number) => void,
onFinish?: (items: any[], rowsProcessed: number) => void,
onError?: (err) => void,
useMemoryForItems?: boolean,
backwards?: boolean
}} options An object containing processing instructions.
*/
exports.createReader = options => new FastXlsxReader(options).createReader();