forked from sheetjs/sheetjs
SheetJS
0b6ebc67da
- DBF write type N and roundtrip C length (fixes #1888 h/t@bandizsolt) - clean up xhr demo (fixes #2604 h/t @UP2022742) - clean up vue / nuxt demo
21 lines
434 B
JavaScript
21 lines
434 B
JavaScript
// nuxt.config.js
|
|
import { readFile, utils } from 'xlsx';
|
|
|
|
const parseXLSX = (file, { path }) => {
|
|
const wb = readFile(path);
|
|
const o = wb.SheetNames.map(name => ({ name, data: utils.sheet_to_json(wb.Sheets[name])}));
|
|
return { data: o };
|
|
}
|
|
|
|
export default {
|
|
modules: [ '@nuxt/content' ],
|
|
content: {
|
|
extendParser: {
|
|
".numbers": parseXLSX,
|
|
".xlsx": parseXLSX,
|
|
".xls": parseXLSX
|
|
// ...
|
|
}
|
|
},
|
|
}
|