Last active
June 29, 2017 17:22
-
-
Save janikvonrotz/7dc07c134f56d0e20be50826af67cb55 to your computer and use it in GitHub Desktop.
Create index.js for node.js project
#PowerShell
#Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$import = "" | |
$export = @() | |
Get-ChildItem | Where-Object{!@("store", "index").contains($_.BaseName)} | ForEach-Object{ | |
$import += "import $($_.baseName) from '$($_.baseName)';`n" | |
$export += $_.BaseName | |
} | |
@" | |
$($import) | |
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