README and Markdown

A README written in Markdown is your project's front page on GitHub.

A file named README.md is displayed automatically on your repository's home page. It should explain what the project is, how to install it, and how to use it.

Markdown basics

  • # Heading and ## Subheading.
  • **bold** and *italic*.
  • - item for bullet lists.
  • Fenced code blocks between triple backticks.
  • [text](url) for links and ![alt](url) for images.

GitHub also renders tables, task lists (- [ ]), and emoji shortcodes.

Example

Example · yaml
# My Project

A short one-line description.

## Installation

```bash
npm install my-project
```

## Features

- [x] Fast
- [x] Documented
- [ ] Themeable

## License

MIT

When to use it

  • An open-source maintainer writes a README with install instructions, badges, and a code example so users can get started in under five minutes.
  • A team adds a badge showing the CI status to the README so anyone landing on the repo instantly sees whether the build is passing.
  • A developer uses Markdown tables in a README to compare configuration options, making them easier to scan than a prose paragraph.

More examples

Basic README with install section

A minimal README covering the project name, description, install command, and a quick-start code snippet.

Example · bash
cat README.md
# My Library

A fast JSON parser for Node.js.

## Installation

```bash
npm install my-library
```

## Usage

```js
const parse = require('my-library');
console.log(parse('{"a":1}'));
```

Add a CI status badge

An inline Markdown image pointing to the GitHub Actions badge URL renders a live build-status shield on the repo page.

Example · bash
cat README.md
# My Library

![CI](https://github.com/username/my-library/actions/workflows/ci.yml/badge.svg)

A fast JSON parser for Node.js.

Markdown table for option reference

A pipe-delimited Markdown table gives readers a scannable reference for all configuration options.

Example · bash
cat README.md
## Options

| Option    | Type    | Default | Description             |
|-----------|---------|---------|-------------------------|
| strict    | boolean | false   | Throw on unknown keys   |
| maxDepth  | number  | 10      | Max nesting depth       |
| encoding  | string  | utf8    | Input string encoding   |

Discussion

  • Be the first to comment on this lesson.