GitHub README and Licenses

Every good project needs a clear explanation. When someone visits your GitHub repository, the README file is usually the first thing they see. A well-written README helps others understand what your project does, how to use it, and how to contribute. Along with a README, adding a license tells people what they can or can't do with your code. In this lesson, you'll learn how to create a helpful README and choose the right open-source license.

Writing a Clear and Useful README

Your README should tell people what your project is about and how to use it. Start by explaining the purpose of your app or tool in one or two lines. Then include sections like:

  • Installation – how to set it up
  • Usage – how to run or use it
  • Examples – optional, but helpful code snippets
  • Contributing – how others can help improve it

Create a file named README.md in your project root folder. The .md stands for Markdown, a simple way to format text.

Example:

# My Weather App A simple Node.js app to check weather in your city.

Installation

javascript
1
2
3
          
--bash
npm install
        

Usage

javascript
1
          node app.js
        
javascript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
          
### Adding Badges and Markdown Styling

Badges are small images that show project status like build passing, license type, or number of downloads. You can get badges from websites like [shields.io](https://shields.io/) and paste the badge code in your README.

Markdown lets you style your text. You can add:

- `#` for headings
- `**bold**` or `_italic_` for text
- Lists with `-` or numbers
- Code blocks using backticks ```

These make your README easier to read and more professional.

### Choosing an Open Source License

Licensing your code is important if you're sharing it publicly. Without a license, others can see your code but can’t legally use or change it. Popular open-source licenses include:

- **MIT** – very permissive, allows almost anything
- **GPL** – requires others to open source their changes
- **Apache 2.0** – allows use with some legal protection

You can add a license to your repo by creating a `LICENSE` file. GitHub also lets you choose a license when creating a new repo.

Choosing the right license depends on how you want your code to be used. For most simple projects, the MIT license works well and is easy to understand.