Skip to content

Getting started

Doron Brayer edited this page Aug 16, 2018 · 72 revisions

Prerequisites

Git for Windows & macOS

  • Download the correct and most recent Git installer:
    Git installer for Windows | Git installer for macOS
  • Start the installer. The 'Git Setup' window will pop up.
  • Complete the installation by following the prompts ('Next' and 'Finish'). The default options are pretty sensible for most users.
  • Open Windows PowerShell or macOS Terminal (or Git Bash, if during installation you selected not to use Git from the default CLI), use it to run the following command.
  • Verify the installation by typing git --version. The version number will be printed, for example git version 2.17.1.

Git for Linux

  • Open the terminal, use it to run the following commands.
  • For users of Ubuntu / Debian / Linux Mint / elementary OS:
    First, update your system's package list by typing sudo apt-get update -y
    Second, install Git by typing sudo apt-get install -y git
    For users of Fedora / openSUSE / CentOS / RHEL:
    First, update your system's package list by typing sudo yum -y update
    Second, install Git by typing sudo yum -y install git
  • Verify the installation by typing git --version. The version number will be printed, for example git version 2.17.1.

Git configuration (git config)

  • Set a Git username by typing git config --global user.name "Bruce Wayne"
  • Set your email address by typing git config --global user.email "[email protected]"

*Use your true details, of course. These details will be associated with any commit you create.

Node.js for Windows & macOS

  • Download the correct (according to your operating system) and most recent Node.js installer directly from Nodejs.org - Downloads page
  • Start the installer. The 'Node.js Setup' window will pop up.
  • Complete the installation by following the prompts ('Next' and 'Finish'). The default options are pretty sensible for most users.
    *** Notes ***
    (A) The installer automatically modifies the Path variable in Windows, so that you can run npm commands from PowerShell (or CMD, if you will).
    (B) npm is bundled with Node.js.
  • Open Windows PowerShell or macOS Terminal, use it to run the following command.
  • Verify the installation by typing node -v. The version number will be printed, for example v8.9.4.

Node.js for Linux

  • Open the terminal, use it to run the following commands.
  • For users of Ubuntu / Debian / Linux Mint / elementary OS:
    First, add the Node.js repository by typing curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
    Second, install Node.js by typing sudo apt-get install -y nodejs
  • For users of Fedora / openSUSE / CentOS / RHEL:
    First, add the Node.js repository by typing curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
    Second, install Node.js by typing sudo yum -y install nodejs
    *** Notes ***
    (A) Change the version number accordingly: setup_9.x for Node.js 9, setup_10.x for Node.js 10, etc.
    (B) The repository above is built and hosted by NodeSource. Support can be found on GitHub at nodesource/distributions.
    (C) npm is bundled with Node.js.
  • Verify the installation by typing node -v. The version number will be printed, for example v8.9.4.

Installation

Installation via Git

  • On GitHub, navigate to the main page of the repository/project.
  • Under the repository description, click Clone or download.
  • Under 'Clone with HTTPs' headline, copy the URL of the repository.
  • Open the relevant CLI (depending on your operating system), or simply open Git Bash.
  • Go into the parent directory (the location where you want to place the repository) by typing the path to that directory, for example cd c:\path\to\parent-of-projects
  • From within the parent directory, initiate the cloning process by typing git clone and pasting the URL you copied in Step 2, for example git clone https://github.com/USERNAME/REPOSITORY-NAME. Your local repository will be created (as a clone of the original one) in the parent directory.
  • Go into your project directory by typing the path to that directory, for example cd c:\path\to\project-name
  • From within the project directory, type npm install. The dependencies will be installed in the local 'node_modules' directory (which is located in your project directory).
    *You can view a list of dependencies by typing npm list -depth 0

npm: Installation as an add-on, instead of a standalone project

  1. Open the CLI, use it to run the following commands.
  2. Go into the parent directory (the location where you want to place the package directory) by typing cd c:\path\to\parent-of-projects
  3. Type npm install <package-name>. The package will be installed along with its dependencies.

*By default, packages are dropped into the 'node_modules' directory.

Yarn: Installation as an add-on, instead of a standalone project

  1. Open the CLI, use it to run the following commands.
  2. Go into the parent directory (the location where you want to place the package directory) by typing the path to that directory, for example cd c:\path\to\parent-of-projects
  3. From within the parent directory, type yarn add <package-name>. The package will be installed along with its dependencies, which results in this kind of path: c:\path\to\parent-of-projects\project-name\node_modules\package-name.

*By default, packages are dropped into the 'node_modules' directory.

CDN - for a quick and easy usage

Place the following code within <head> element of your HTML document.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/packagename/1.0.3/filename.min.js">

Place the following script at the bottom of the <body> element of your HTML document.

<script src="https://cdnjs.cloudflare.com/ajax/libs/packagename/1.0.3/filename.min.css"></script>

Download the source code - for development & customization

  • Download the source code.
  • Extract the project directory from the downloaded bundle (usually .zip or .tar), place it in your preferred location.
  • Go into your project directory by typing cd c:\path\to\project-name
  • Type npm install. The dependencies will be installed in the local 'node_modules' directory (which is located in your project directory).

*This bundle includes (or may include) inline comments, prologue comments, documentation, reports, build tools, test tools, documents (.md, .txt, .pdf, .odt), vendor libraries, optional dependencies. Use it to make your own ready-to-use edition.

Download the compiled code - for production

This bundle does NOT include inline comments, prologue comments, documentation, reports, build tools, test tools, documents (.md, .txt, .pdf, .odt), vendor libraries, optional dependencies. Also, many files are (or may be) minified. Place the files in the relevant directory, and use it as is.
Download the compiled code.

Clone this wiki locally