Skip to content

Instantly share code, notes, and snippets.

@benjaminudoh10
Created January 2, 2023 14:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjaminudoh10/f9979cbb846825f77c727c3b7a9f133f to your computer and use it in GitHub Desktop.
Save benjaminudoh10/f9979cbb846825f77c727c3b7a9f133f to your computer and use it in GitHub Desktop.
Bootstrap NodeJS Application
#!/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