read-excel-file 2.0.5 → 2.0.10
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 +2 -0
- package/README.md +11 -3
- package/bundle/read-excel-file.min.js +1 -1
- package/bundle/read-excel-file.min.js.map +1 -1
- package/commonjs/readXlsx.js +37 -2
- package/commonjs/readXlsx.js.map +1 -1
- package/commonjs/readXlsxFileContents.js +1 -1
- package/commonjs/readXlsxFileContents.js.map +1 -1
- package/commonjs/xmlBrowser.js +3 -1
- package/commonjs/xmlBrowser.js.map +1 -1
- package/index.commonjs.js +1 -0
- package/index.js +1 -0
- package/modules/readXlsx.js +37 -2
- package/modules/readXlsx.js.map +1 -1
- package/modules/readXlsxFileContents.js +1 -1
- package/modules/readXlsxFileContents.js.map +1 -1
- package/modules/xmlBrowser.js +3 -1
- package/modules/xmlBrowser.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ input.addEventListener('change', () => {
|
|
|
32
32
|
## Node.js
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
|
-
|
|
35
|
+
const readXlsxFile = require('read-excel-file/node');
|
|
36
36
|
|
|
37
37
|
// File path.
|
|
38
38
|
readXlsxFile('/path/to/file').then((rows) => {
|
|
@@ -165,17 +165,25 @@ Node.js `*.xlxs` parser uses `xpath` and `xmldom` universal packages for XML par
|
|
|
165
165
|
By default it reads the first sheet in the document. If you have multiple sheets in your spreadsheet then pass `sheet: number` or `sheet: string` as part of the `options` argument (`options.sheet` is `1` by default):
|
|
166
166
|
|
|
167
167
|
```js
|
|
168
|
-
readXlsxFile(
|
|
168
|
+
readXlsxFile(file, { sheet: 2 }).then((data) => {
|
|
169
169
|
...
|
|
170
170
|
})
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
```js
|
|
174
|
-
readXlsxFile(
|
|
174
|
+
readXlsxFile(file, { sheet: 'Sheet1' }).then((data) => {
|
|
175
175
|
...
|
|
176
176
|
})
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
+
To get the list of sheets one can pass `getSheets: true` option:
|
|
180
|
+
|
|
181
|
+
```js
|
|
182
|
+
readXlsxFile(file, { getSheets: true }).then((sheets) => {
|
|
183
|
+
// sheets === { 1: 'Sheet1', 2: 'Sheet2' }
|
|
184
|
+
})
|
|
185
|
+
```
|
|
186
|
+
|
|
179
187
|
## References
|
|
180
188
|
|
|
181
189
|
For XML parsing [`xmldom`](https://github.com/jindw/xmldom) and [`xpath`](https://github.com/goto100/xpath) are used.
|