import Head from 'next/head'; import Link from "next/link"; import { readFile, set_fs, utils } from 'xlsx'; import { join } from 'path'; import { cwd } from 'process'; export default function Index({type, snames}) { return (
{`SheetJS Next.JS ${type} Demo`}
    

{`SheetJS Next.JS ${type} Demo`}

This demo reads from /sheetjs.xlsx

Each worksheet maps to a path:

); } export async function getStaticProps() { set_fs(await import("fs")); const wb = readFile(join(cwd(), "sheetjs.xlsx")) return { props: { type: "getStaticPaths", snames: wb.SheetNames, }, } }