Skip to content

Instantly share code, notes, and snippets.

@benjaminudoh10
Created January 2, 2023 14:16
Show Gist options
  • Save benjaminudoh10/f9979cbb846825f77c727c3b7a9f133f to your computer and use it in GitHub Desktop.
Save benjaminudoh10/f9979cbb846825f77c727c3b7a9f133f to your computer and use it in GitHub Desktop.

Revisions

  1. benjaminudoh10 created this gist Jan 2, 2023.
    21 changes: 21 additions & 0 deletions bootstrap-node-app.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/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