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)

  • Open the CLI (or Git Bash, if you will), use it to run the following commands.
  • Set a Git username by typing git config --global user.name "Bruce Wayne"
  • Set your email address by typing git config --global user.email "bruce.wayne@wayneenterprises.com"

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

Node.js for Windows & macOS

  • Download the relevant 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.
  • Copy the URL of the repository.
  • Open the CLI (or Git Bash, if you will), use it to run the following commands.
  • 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. A local repository will be created (as a clone of the original repo) in the parent directory.
  • Go into the local repository (a.k.a. project directory) by typing the path to that directory, for example cd c:\path\to\project-name
  • From within the local repository (a.k.a. project directory), install the dependencies by typing npm install. The dependencies will be installed in the local 'node_modules' directory.

*Keep the local repository synchronized with the original repository by typing the relevant Git commands, such as git pull
*View a list of dependencies by typing npm list -depth 0

Installation via package manager

  • Open the CLI, use it to run the following commands.
  • Go into the relevant 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\project-name
  • For npm users:
    From within the directory, install the package by typing npm install <package-name>
    For Yarn users:
    From within the directory, install the package by typing 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.
*Use this installation only for enhancing an existing project. If you intend to use the components as a standalone project, you should use another method of installation.

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 bundle - source code.
  • Extract the directory from the downloaded bundle (usually .zip or .tar), place it in your preferred location.
  • Go into the extracted directory (a.k.a. project directory) by typing the path to that directory, for example cd c:\path\to\project-name
  • From within the extracted directory (a.k.a. project directory), install the dependencies by typing npm install. The dependencies will be installed in the local 'node_modules' 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

Download the bundle - compiled code.

*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.