Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create index.js for node.js project #PowerShell #Node.js
$import = ""
$export = @()
Get-ChildItem | Where-Object{!@("store", "index").contains($_.BaseName)} | ForEach-Object{
$import += "import $($_.baseName) from '$($_.baseName)';`n"
$export += $_.BaseName
export { $($export -join(', ')) }
"@ | Out-File -Encoding utf8 'index.js'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.