Skip to content

Instantly share code, notes, and snippets.

@bsnux
Created January 3, 2020 19:57
Show Gist options
  • Save bsnux/b056acd3108480ef63f8982aa9f9c803 to your computer and use it in GitHub Desktop.
Save bsnux/b056acd3108480ef63f8982aa9f9c803 to your computer and use it in GitHub Desktop.
Simple boilerplate generator for TypeScript projects
#!/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