officeparser 2.3.0 → 3.1.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/README.md CHANGED
@@ -1,323 +1,337 @@
1
- # officeParser
2
- A Node.js library to parse text out of any office file.
3
-
4
- ### Supported File Types
5
-
6
- - [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML)
7
- - [`pptx`](https://en.wikipedia.org/wiki/Office_Open_XML)
8
- - [`xlsx`](https://en.wikipedia.org/wiki/Office_Open_XML)
9
- - [`odt`](https://en.wikipedia.org/wiki/OpenDocument)
10
- - [`odp`](https://en.wikipedia.org/wiki/OpenDocument)
11
- - [`ods`](https://en.wikipedia.org/wiki/OpenDocument)
12
-
13
-
14
- #### Update
15
- * 2021/11/21 - Added promise way to existing callback functions
16
- * 2020/06/01 - Added error handling and console.log enable/disable methods. Default is set at enabled. Everything backward compatible.
17
- * 2019/06/17 - Added method to change location for decompressing office files in places with restricted write access.
18
- * 2019/04/30 - Removed case sensitive file extension bug. File names with capital lettered extensions now supported.
19
- * 2019/04/23 - Added support for open office files *.odt, *.odp, *.ods through parseOffice function. Created a new method parseOpenOffice for those who prefer targetted functions.
20
- * 2019/04/23 - Added feature to delete the generated dist folder after function callback
21
- * 2019/04/22 - Added parseOffice method to avoid confusion between type of file and their extension
22
- * 2019/04/22 - Added file extension validations. Removed errors for excel files with no drawing elements.
23
- * 2019/04/19 - Support added for *.xlsx files.
24
- * 2019/04/18 - Support added for *.pptx files.
25
-
26
-
27
-
28
- ## Install via npm
29
-
30
-
31
- ```
32
- npm i officeparser
33
- ```
34
-
35
- ----------
36
-
37
- **Usage**
38
- ```js
39
- const officeParser = require('officeparser');
40
-
41
- // callback
42
- officeParser.parseOffice("/path/to/officeFile", function(data, err){
43
- // "data" string in the callback here is the text parsed from the office file passed in the first argument above
44
- if (err) return console.log(err);
45
- console.log(data)
46
- })
47
-
48
- // promise
49
- officeParser.parseOfficeAsync("/path/to/officeFile");
50
- // "data" string in the promise here is the text parsed from the office file passed in the argument above
51
- .then((data) => {
52
- console.log(data)
53
- })
54
- .catch(err) => {
55
- console.log(err)
56
- }
57
-
58
- // async/await
59
- try {
60
- // "data" string returned from promise here is the text parsed from the office file passed in the argument
61
- const data = await officeParser.parseOfficeAsync("/path/to/officeFile");
62
- console.log(data);
63
- } catch (err) {
64
- // resolve error
65
- console.log(err);
66
- }
67
- ```
68
-
69
- **Please take note: I have breached convention in placing err as second argument in my callback but please understand that I had to do it to not break other people's existing modules.**
70
-
71
- *Optionally change decompression location for office Files at personalised locations for environments with restricted write access*
72
-
73
- ```js
74
- const officeParser = require('officeparser');
75
-
76
- // Default decompress location for office Files is "officeDist" in the directory where Node is started.
77
- // Put this file before parseOffice method to take effect.
78
- officeParser.setDecompressionLocation("/tmp"); // New decompression location would be "/tmp/officeDist"
79
-
80
- // P.S.: Setting location on a Windows environment with '\' hierarchy requires to be entered twice '\\'
81
- officeParser.setDecompressionLocation("C:\\tmp"); // New decompression location would be "C:\tmp\officeDist"
82
-
83
-
84
- officeParser.parseOffice("/path/to/officeFile", function(data, err){
85
- // "data" string in the callback here is the text parsed from the office file passed in the first argument above
86
- if (err) return console.log(err);
87
- console.log(data)
88
- })
89
- ```
90
-
91
- *Optionally add false as 3rd variable to parseOffice to not delete the generated officeDist folder*
92
-
93
- ```js
94
- // callback
95
- officeParser.parseOffice("/path/to/officeFile", function(data, err){
96
- if (err) return console.log(err);
97
- console.log(data)
98
- }, false)
99
-
100
- // promise
101
- officeParser.parseOfficeAsync("/path/to/officeFile", false);
102
- .then((data) => {
103
- console.log(data)
104
- })
105
- .catch(err) => {
106
- console.log(err)
107
- }
108
-
109
- // async/await
110
- try {
111
- const data = await officeParser.parseOfficeAsync("/path/to/officeFile", false);
112
- console.log(data);
113
- } catch (err) {
114
- // resolve error
115
- console.log(err);
116
- }
117
- ```
118
-
119
- **Example**
120
- ```js
121
- const officeParser = require('officeparser');
122
-
123
- // callback
124
- officeParser.parseOffice("C:\\files\\myText.docx", function(data, err){
125
- if (err) return console.log(err);
126
- var newText = data + "look, I can parse a word file"
127
- callSomeOtherFunction(newText);
128
- })
129
-
130
-
131
- // promise
132
- officeParser.parseOfficeAsync("/Users/harsh/Desktop/files/mySlides.pptx");
133
- .then((data) => {
134
- var newText = data + "look, I can parse a powerpoint file"
135
- callSomeOtherFunction(newText);
136
- })
137
- .catch(err) => {
138
- console.log(err)
139
- }
140
-
141
- // Using relative path for file is also fine
142
- officeParser.parseOffice("files/myWorkSheet.ods", function(data, err){
143
- if (err) return console.log(err);
144
- var newText = data + "look, I can parse an excel file"
145
- callSomeOtherFunction(newText);
146
- })
147
-
148
- // async/await
149
- try {
150
- const data = await officeParser.parseOfficeAsync("/Users/harsh/Desktop/files/mySlides.pptx");
151
- let newText = data + "look, I can parse a powerpoint file";
152
- await callSomeOtherFunction(newText);
153
- } catch (err) {
154
- // resolve error
155
- console.log(err);
156
- }
157
- ```
158
-
159
-
160
- ----------
161
-
162
- ### Old but functional way of extracting text from word, powerpoint and excel files
163
- *These were the initial methods of parsing text till parseOffice method came into existence. These still exist and form the skeleton to this module as parseOffice redirects the below functions anyway. These functions will forever remain available to guarantee long-term usage of this module. I will ensure backward-compatibility with all previous versions.*
164
-
165
- **Usage**
166
- ```js
167
- const officeParser = require('officeparser');
168
-
169
- // callback
170
- officeParser.parseWord("/path/to/word.docx", function(data, err){
171
- // "data" string in the callback here is the text parsed from the word file passed in the first argument above
172
- if (err) return console.log(err);
173
- console.log(data)
174
- })
175
-
176
- officeParser.parsePowerPoint("/path/to/powerpoint.pptx", function(data, err){
177
- // "data" string in the callback here is the text parsed from the powerpoint file passed in the first argument above
178
- if (err) return console.log(err);
179
- console.log(data)
180
- })
181
-
182
- officeParser.parseExcel("/path/to/excel.xlsx", function(data, err){
183
- // "data" string in the callback here is the text parsed from the excel file passed in the first argument above
184
- if (err) return console.log(err);
185
- console.log(data)
186
- })
187
-
188
- officeParser.parseOpenOffice("/path/to/writer.odt", function(data, err){
189
- // "data" string in the callback here is the text parsed from the writer file passed in the first argument above
190
- if (err) return console.log(err);
191
- console.log(data)
192
- })
193
-
194
- // promise
195
- officeParser.parseWordAsync("/path/to/word.docx");
196
- .then((data) => {
197
- // data is the parsed text
198
- })
199
- officeParser.parsePowerPointAsync("/path/to/powerpoint.pptx");
200
- .then((data) => {
201
- // data is the parsed text
202
- })
203
- officeParser.parseExcelAsync("/path/to/excel.xlsx");
204
- .then((data) => {
205
- // data is the parsed text
206
- })
207
- officeParser.parseOpenOfficeAsync("/path/to/writer.odt");
208
- .then((data) => {
209
- // data is the parsed text
210
- })
211
-
212
- // async/await
213
- try {
214
- // "data" string returned from promise here is the text parsed from the office file passed in the first argument
215
- const data1 = await officeParser.parseWordAsync("/path/to/word.docx");
216
-
217
- const data2 = await officeParser.parsePowerPointAsync("/path/to/powerpoint.pptx");
218
-
219
- const data3 = await officeParser.parseExcelAsync("/path/to/excel.xlsx");
220
-
221
- const data3 = await officeParser.parseOpenOfficeAsync("/path/to/writer.odt");
222
- } catch (err) {
223
- // resolve error
224
- console.log(err);
225
- }
226
- ```
227
-
228
- **Example**
229
- ```js
230
- const officeParser = require('officeparser');
231
-
232
- // callback
233
- officeParser.parseWord("C:\\files\\myText.docx", function(data, err){
234
- if (err) return console.log(err);
235
- var newText = data + "look, I can parse a word file"
236
- callSomeOtherFunction(newText);
237
- })
238
-
239
- officeParser.parsePowerPoint("/Users/harsh/Desktop/files/mySlides.pptx", function(data, err){
240
- if (err) return console.log(err);
241
- var newText = data + "look, I can parse a powerpoint file"
242
- callSomeOtherFunction(newText);
243
- })
244
-
245
- // Using relative path for file is also fine
246
- officeParser.parseExcel("files/myWorkSheet.xlsx", function(data, err){
247
- if (err) return console.log(err);
248
- var newText = data + "look, I can parse an excel file"
249
- callSomeOtherFunction(newText);
250
- })
251
-
252
- officeParser.parseOpenOffice("files/myDocument.odt", function(data, err){
253
- if (err) return console.log(err);
254
- var newText = data + "look, I can parse an OpenOffice file"
255
- callSomeOtherFunction(newText);
256
- })
257
-
258
- // promise
259
- officeParser.parseWordAsync("C:\\files\\myText.docx");
260
- .then((data) => {
261
- let newText1 = data1 + "look, I can parse a word file";
262
- callSomeOtherFunction(newText1);
263
- })
264
- .catch(err) => {
265
- console.log(err)
266
- }
267
-
268
- officeParser.parsePowerPointAsync("/Users/harsh/Desktop/files/mySlides.pptx");
269
- .then((data) => {
270
- let newText2 = data2 + "look, I can parse a powerpoint file";
271
- callSomeOtherFunction(newText2);
272
- })
273
- .catch(err) => {
274
- console.log(err)
275
- }
276
-
277
- officeParser.parseExcelAsync("files/myWorkSheet.xlsx");
278
- .then((data) => {
279
- let newText3 = data3 + "look, I can parse an excel file";
280
- callSomeOtherFunction(newText3);
281
- })
282
- .catch(err) => {
283
- console.log(err)
284
- }
285
-
286
- officeParser.parseOpenOfficeAsync("files/myDocument.odt");
287
- .then((data) => {
288
- let newText4 = data4 + "look, I can parse an OpenOffice file";
289
- callSomeOtherFunction(newText4);
290
- })
291
- .catch(err) => {
292
- console.log(err)
293
- }
294
-
295
-
296
- // async/await
297
- try {
298
- const data1 = await officeParser.parseWordAsync("C:\\files\\myText.docx");
299
- let newText1 = data1 + "look, I can parse a word file";
300
- await callSomeOtherFunction(newText1);
301
-
302
- const data2 = await officeParser.parsePowerPointAsync("/Users/harsh/Desktop/files/mySlides.pptx");
303
- let newText2 = data2 + "look, I can parse a powerpoint file";
304
- await callSomeOtherFunction(newText2);
305
-
306
- // Using relative path for file is also fine
307
- const data3 = await officeParser.parseExcelAsync("files/myWorkSheet.xlsx");
308
- let newText3 = data3 + "look, I can parse an excel file";
309
- await callSomeOtherFunction(newText3);
310
-
311
- const data4 = await officeParser.parseOpenOfficeAsync("files/myDocument.odt");
312
- let newText4 = data4 + "look, I can parse an OpenOffice file";
313
- await callSomeOtherFunction(newText4);
314
- } catch (err) {
315
- // resolve error
316
- console.log(err);
317
- }
318
- ```
319
-
320
- ----------
321
-
322
- **github**
323
- https://github.com/harshankur/officeParser
1
+ # officeParser
2
+ A Node.js library to parse text out of any office file.
3
+
4
+ ### Supported File Types
5
+
6
+ - [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML)
7
+ - [`pptx`](https://en.wikipedia.org/wiki/Office_Open_XML)
8
+ - [`xlsx`](https://en.wikipedia.org/wiki/Office_Open_XML)
9
+ - [`odt`](https://en.wikipedia.org/wiki/OpenDocument)
10
+ - [`odp`](https://en.wikipedia.org/wiki/OpenDocument)
11
+ - [`ods`](https://en.wikipedia.org/wiki/OpenDocument)
12
+
13
+
14
+ #### Update
15
+ * 2022/12/24 - Added command line method to use officeParser with or without installing it and instantly get parsed content on the console.
16
+ * 2022/12/10 - Fixed memory leak issues, bugs related to parsing open document files and improved error handling.
17
+ * 2021/11/21 - Added promise way to existing callback functions.
18
+ * 2020/06/01 - Added error handling and console.log enable/disable methods. Default is set at enabled. Everything backward compatible.
19
+ * 2019/06/17 - Added method to change location for decompressing office files in places with restricted write access.
20
+ * 2019/04/30 - Removed case sensitive file extension bug. File names with capital lettered extensions now supported.
21
+ * 2019/04/23 - Added support for open office files *.odt, *.odp, *.ods through parseOffice function. Created a new method parseOpenOffice for those who prefer targetted functions.
22
+ * 2019/04/23 - Added feature to delete the generated dist folder after function callback.
23
+ * 2019/04/22 - Added parseOffice method to avoid confusion between type of file and their extension.
24
+ * 2019/04/22 - Added file extension validations. Removed errors for excel files with no drawing elements.
25
+ * 2019/04/19 - Support added for *.xlsx files.
26
+ * 2019/04/18 - Support added for *.pptx files.
27
+
28
+
29
+
30
+ ## Install via npm
31
+
32
+
33
+ ```
34
+ npm i officeparser
35
+ ```
36
+
37
+ ## Command Line usage
38
+ If you have already installed officeParser, then follow below command
39
+ for extracting content from a file sampleFile
40
+ ```
41
+ node officeParser.js <fileName>
42
+ ```
43
+
44
+ If you have not installed the library, you can use npx to instantly extract parsed data.
45
+ ```
46
+ npx officeparser <fileName>
47
+ ```
48
+
49
+ ----------
50
+
51
+ **Library Usage**
52
+ ```js
53
+ const officeParser = require('officeparser');
54
+
55
+ // callback
56
+ officeParser.parseOffice("/path/to/officeFile", function(data, err){
57
+ // "data" string in the callback here is the text parsed from the office file passed in the first argument above
58
+ if (err) return console.log(err);
59
+ console.log(data)
60
+ })
61
+
62
+ // promise
63
+ officeParser.parseOfficeAsync("/path/to/officeFile");
64
+ // "data" string in the promise here is the text parsed from the office file passed in the argument above
65
+ .then((data) => {
66
+ console.log(data)
67
+ })
68
+ .catch(err) => {
69
+ console.log(err)
70
+ }
71
+
72
+ // async/await
73
+ try {
74
+ // "data" string returned from promise here is the text parsed from the office file passed in the argument
75
+ const data = await officeParser.parseOfficeAsync("/path/to/officeFile");
76
+ console.log(data);
77
+ } catch (err) {
78
+ // resolve error
79
+ console.log(err);
80
+ }
81
+ ```
82
+
83
+ **Please take note: I have breached convention in placing err as second argument in my callback but please understand that I had to do it to not break other people's existing modules.**
84
+
85
+ *Optionally change decompression location for office Files at personalised locations for environments with restricted write access*
86
+
87
+ ```js
88
+ const officeParser = require('officeparser');
89
+
90
+ // Default decompress location for office Files is "officeDist" in the directory where Node is started.
91
+ // Put this file before parseOffice method to take effect.
92
+ officeParser.setDecompressionLocation("/tmp"); // New decompression location would be "/tmp/officeDist"
93
+
94
+ // P.S.: Setting location on a Windows environment with '\' hierarchy requires to be entered twice '\\'
95
+ officeParser.setDecompressionLocation("C:\\tmp"); // New decompression location would be "C:\tmp\officeDist"
96
+
97
+
98
+ officeParser.parseOffice("/path/to/officeFile", function(data, err){
99
+ // "data" string in the callback here is the text parsed from the office file passed in the first argument above
100
+ if (err) return console.log(err);
101
+ console.log(data)
102
+ })
103
+ ```
104
+
105
+ *Optionally add false as 3rd variable to parseOffice to not delete the generated officeDist folder*
106
+
107
+ ```js
108
+ // callback
109
+ officeParser.parseOffice("/path/to/officeFile", function(data, err){
110
+ if (err) return console.log(err);
111
+ console.log(data)
112
+ }, false)
113
+
114
+ // promise
115
+ officeParser.parseOfficeAsync("/path/to/officeFile", false);
116
+ .then((data) => {
117
+ console.log(data)
118
+ })
119
+ .catch(err) => {
120
+ console.log(err)
121
+ }
122
+
123
+ // async/await
124
+ try {
125
+ const data = await officeParser.parseOfficeAsync("/path/to/officeFile", false);
126
+ console.log(data);
127
+ } catch (err) {
128
+ // resolve error
129
+ console.log(err);
130
+ }
131
+ ```
132
+
133
+ **Example**
134
+ ```js
135
+ const officeParser = require('officeparser');
136
+
137
+ // callback
138
+ officeParser.parseOffice("C:\\files\\myText.docx", function(data, err){
139
+ if (err) return console.log(err);
140
+ var newText = data + "look, I can parse a word file"
141
+ callSomeOtherFunction(newText);
142
+ })
143
+
144
+
145
+ // promise
146
+ officeParser.parseOfficeAsync("/Users/harsh/Desktop/files/mySlides.pptx");
147
+ .then((data) => {
148
+ var newText = data + "look, I can parse a powerpoint file"
149
+ callSomeOtherFunction(newText);
150
+ })
151
+ .catch(err) => {
152
+ console.log(err)
153
+ }
154
+
155
+ // Using relative path for file is also fine
156
+ officeParser.parseOffice("files/myWorkSheet.ods", function(data, err){
157
+ if (err) return console.log(err);
158
+ var newText = data + "look, I can parse an excel file"
159
+ callSomeOtherFunction(newText);
160
+ })
161
+
162
+ // async/await
163
+ try {
164
+ const data = await officeParser.parseOfficeAsync("/Users/harsh/Desktop/files/mySlides.pptx");
165
+ let newText = data + "look, I can parse a powerpoint file";
166
+ await callSomeOtherFunction(newText);
167
+ } catch (err) {
168
+ // resolve error
169
+ console.log(err);
170
+ }
171
+ ```
172
+
173
+
174
+ ----------
175
+
176
+ ### Old but functional way of extracting text from word, powerpoint and excel files
177
+ *These were the initial methods of parsing text till parseOffice method came into existence. These still exist and form the skeleton to this module as parseOffice redirects the below functions anyway. These functions will forever remain available to guarantee long-term usage of this module. I will ensure backward-compatibility with all previous versions.*
178
+
179
+ **Usage**
180
+ ```js
181
+ const officeParser = require('officeparser');
182
+
183
+ // callback
184
+ officeParser.parseWord("/path/to/word.docx", function(data, err){
185
+ // "data" string in the callback here is the text parsed from the word file passed in the first argument above
186
+ if (err) return console.log(err);
187
+ console.log(data)
188
+ })
189
+
190
+ officeParser.parsePowerPoint("/path/to/powerpoint.pptx", function(data, err){
191
+ // "data" string in the callback here is the text parsed from the powerpoint file passed in the first argument above
192
+ if (err) return console.log(err);
193
+ console.log(data)
194
+ })
195
+
196
+ officeParser.parseExcel("/path/to/excel.xlsx", function(data, err){
197
+ // "data" string in the callback here is the text parsed from the excel file passed in the first argument above
198
+ if (err) return console.log(err);
199
+ console.log(data)
200
+ })
201
+
202
+ officeParser.parseOpenOffice("/path/to/writer.odt", function(data, err){
203
+ // "data" string in the callback here is the text parsed from the writer file passed in the first argument above
204
+ if (err) return console.log(err);
205
+ console.log(data)
206
+ })
207
+
208
+ // promise
209
+ officeParser.parseWordAsync("/path/to/word.docx");
210
+ .then((data) => {
211
+ // data is the parsed text
212
+ })
213
+ officeParser.parsePowerPointAsync("/path/to/powerpoint.pptx");
214
+ .then((data) => {
215
+ // data is the parsed text
216
+ })
217
+ officeParser.parseExcelAsync("/path/to/excel.xlsx");
218
+ .then((data) => {
219
+ // data is the parsed text
220
+ })
221
+ officeParser.parseOpenOfficeAsync("/path/to/writer.odt");
222
+ .then((data) => {
223
+ // data is the parsed text
224
+ })
225
+
226
+ // async/await
227
+ try {
228
+ // "data" string returned from promise here is the text parsed from the office file passed in the first argument
229
+ const data1 = await officeParser.parseWordAsync("/path/to/word.docx");
230
+
231
+ const data2 = await officeParser.parsePowerPointAsync("/path/to/powerpoint.pptx");
232
+
233
+ const data3 = await officeParser.parseExcelAsync("/path/to/excel.xlsx");
234
+
235
+ const data3 = await officeParser.parseOpenOfficeAsync("/path/to/writer.odt");
236
+ } catch (err) {
237
+ // resolve error
238
+ console.log(err);
239
+ }
240
+ ```
241
+
242
+ **Example**
243
+ ```js
244
+ const officeParser = require('officeparser');
245
+
246
+ // callback
247
+ officeParser.parseWord("C:\\files\\myText.docx", function(data, err){
248
+ if (err) return console.log(err);
249
+ var newText = data + "look, I can parse a word file"
250
+ callSomeOtherFunction(newText);
251
+ })
252
+
253
+ officeParser.parsePowerPoint("/Users/harsh/Desktop/files/mySlides.pptx", function(data, err){
254
+ if (err) return console.log(err);
255
+ var newText = data + "look, I can parse a powerpoint file"
256
+ callSomeOtherFunction(newText);
257
+ })
258
+
259
+ // Using relative path for file is also fine
260
+ officeParser.parseExcel("files/myWorkSheet.xlsx", function(data, err){
261
+ if (err) return console.log(err);
262
+ var newText = data + "look, I can parse an excel file"
263
+ callSomeOtherFunction(newText);
264
+ })
265
+
266
+ officeParser.parseOpenOffice("files/myDocument.odt", function(data, err){
267
+ if (err) return console.log(err);
268
+ var newText = data + "look, I can parse an OpenOffice file"
269
+ callSomeOtherFunction(newText);
270
+ })
271
+
272
+ // promise
273
+ officeParser.parseWordAsync("C:\\files\\myText.docx");
274
+ .then((data) => {
275
+ let newText1 = data1 + "look, I can parse a word file";
276
+ callSomeOtherFunction(newText1);
277
+ })
278
+ .catch(err) => {
279
+ console.log(err)
280
+ }
281
+
282
+ officeParser.parsePowerPointAsync("/Users/harsh/Desktop/files/mySlides.pptx");
283
+ .then((data) => {
284
+ let newText2 = data2 + "look, I can parse a powerpoint file";
285
+ callSomeOtherFunction(newText2);
286
+ })
287
+ .catch(err) => {
288
+ console.log(err)
289
+ }
290
+
291
+ officeParser.parseExcelAsync("files/myWorkSheet.xlsx");
292
+ .then((data) => {
293
+ let newText3 = data3 + "look, I can parse an excel file";
294
+ callSomeOtherFunction(newText3);
295
+ })
296
+ .catch(err) => {
297
+ console.log(err)
298
+ }
299
+
300
+ officeParser.parseOpenOfficeAsync("files/myDocument.odt");
301
+ .then((data) => {
302
+ let newText4 = data4 + "look, I can parse an OpenOffice file";
303
+ callSomeOtherFunction(newText4);
304
+ })
305
+ .catch(err) => {
306
+ console.log(err)
307
+ }
308
+
309
+
310
+ // async/await
311
+ try {
312
+ const data1 = await officeParser.parseWordAsync("C:\\files\\myText.docx");
313
+ let newText1 = data1 + "look, I can parse a word file";
314
+ await callSomeOtherFunction(newText1);
315
+
316
+ const data2 = await officeParser.parsePowerPointAsync("/Users/harsh/Desktop/files/mySlides.pptx");
317
+ let newText2 = data2 + "look, I can parse a powerpoint file";
318
+ await callSomeOtherFunction(newText2);
319
+
320
+ // Using relative path for file is also fine
321
+ const data3 = await officeParser.parseExcelAsync("files/myWorkSheet.xlsx");
322
+ let newText3 = data3 + "look, I can parse an excel file";
323
+ await callSomeOtherFunction(newText3);
324
+
325
+ const data4 = await officeParser.parseOpenOfficeAsync("files/myDocument.odt");
326
+ let newText4 = data4 + "look, I can parse an OpenOffice file";
327
+ await callSomeOtherFunction(newText4);
328
+ } catch (err) {
329
+ // resolve error
330
+ console.log(err);
331
+ }
332
+ ```
333
+
334
+ ----------
335
+
336
+ **github**
337
+ https://github.com/harshankur/officeParser