20 lines
714 B
PowerShell
20 lines
714 B
PowerShell
|
|
#!/usr/bin/env pwsh
|
||
|
|
# https://docs.sheetjs.com/docs/demos/bigdata/stream#nodejs
|
||
|
|
|
||
|
|
$oldDir = Get-Location
|
||
|
|
$tempDir = Join-Path -Path $env:TEMP -ChildPath "sheetjs-stream"
|
||
|
|
if (Test-Path -Path $tempDir) { Remove-Item -Path $tempDir -Recurse -Force }
|
||
|
|
New-Item -ItemType Directory -Path $tempDir | Out-Null
|
||
|
|
Set-Location -Path $tempDir
|
||
|
|
|
||
|
|
bun init -y
|
||
|
|
bun i xlsx@https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
|
||
|
|
|
||
|
|
Invoke-WebRequest -Uri "https://docs.sheetjs.com/stream/SheetJSNodeJStream.js" -OutFile "SheetJSNodeJStream.js"
|
||
|
|
Invoke-WebRequest -Uri "https://docs.sheetjs.com/pres.xlsx" -OutFile "pres.xlsx"
|
||
|
|
|
||
|
|
bun --version
|
||
|
|
bun SheetJSNodeJStream.js pres.xlsx
|
||
|
|
|
||
|
|
Set-Location $oldDir
|
||
|
|
Remove-Item -Path $tempDir -Recurse -Force
|