Created
January 2, 2023 14:16
-
-
Save benjaminudoh10/f9979cbb846825f77c727c3b7a9f133f to your computer and use it in GitHub Desktop.
Bootstrap NodeJS Application
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 | |
DIR_NAME=node-app-bootstrap; | |
function bootstrap_node_app() { | |
if which node > /dev/null | |
then | |
mkdir $DIR_NAME; | |
cd $DIR_NAME; | |
npm init -y > /dev/null; | |
npm install express bcryptjs celebrate cors dotenv jsonwebtoken pg; | |
npm install -D mocha chai chai-http prettier eslint eslint-config-prettier husky lint-staged nyc nodemon; | |
echo node_modules/ > .gitignore | |
else | |
# improve script by installing node and then rerun | |
# script automatically | |
exit 1; | |
fi | |
} | |
bootstrap_node_app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment