Created
January 3, 2020 19:57
-
-
Save bsnux/b056acd3108480ef63f8982aa9f9c803 to your computer and use it in GitHub Desktop.
Simple boilerplate generator for TypeScript projects
This file contains hidden or 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
#!/bin/bash | |
#-- | |
# Simple boilerplate generator for TypeScript projects | |
#-- | |
project_name=$1 | |
main_file=${2:-index.ts} | |
mkdir $project_name && cd $project_name | |
npm init -y | |
npm install typescript --save-dev | |
npm install @types/node --save-dev | |
npx tsc --init --rootDir src --outDir build --esModuleInterop --resolveJsonModule --lib es6 --module commonjs --allowJs true --noImplicitAny true | |
mkdir src && touch src/$main_file | |
echo 'build/**\nnode_modules/**' >> .gitignore | |
echo '# $project_name' >> README.md | |
npx tsc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment