docs.sheetjs.com/tests/bigdata/stream-bun.ps1

20 lines
714 B
PowerShell
Raw Permalink Normal View History

2026-01-29 04:58:19 +00:00
#!/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