# Getting Started

*router5* is available in all major formats: **ES6**, **CommonJS**, and **UMD**. It can be installed using **npm** or **yarn**. Alternatively, you can download a specific version from [github](https://github.com/router5/router5/releases).

## Installation

```
# yarn
yarn add router5
# npm
npm install router5
```

## Include router5 in your application

### ES2015 syntax

```javascript
// ES2015+
import createRouter from 'router5';

import browserPlugin from 'router5-plugin-browser';
import persistentParamsPlugin from 'router5-plugin-persistent-params';
```

### CommonJS syntax

```javascript
var createRouter = require('router5').default;
var browserPlugin = require('router5-plugin-browser');
var persistentParamsPlugin = require('router5-plugin-persistent-params');
```

### UMD

Various UMD bundles are accessible under `/dist/umd`: you should use them for AMD or global. The router5 bundle contains all *router5* dependencies (*route-node* and *path-parser*), but doesn't contain plugins.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://router5.js.org/introduction/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
