# froute

> Simple and powerful routing for node with expressive matching

Latest version **0.0.15** (published 2015-02-09) · 0 weekly downloads

## Install

```sh
npm install froute
pnpm add froute
yarn add froute
bun add froute
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.15 |
| Published | 2015-02-09 |
| First published | 2013-11-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.x |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Lee Crossley |
| Maintainers | leecrossley |
| Keywords | froute, route, routing, url, rest, restful, api, web service |

## Links

- npm: https://www.npmjs.com/package/froute
- Repository: git@github.com:leecrossley/froute
- Homepage: http://ilee.co.uk
- Issues: https://github.com/leecrossley/froute/issues
- npm.io page: https://npm.io/package/froute

## Dependencies (2)

- [froute-picker](https://npm.io/package/froute-picker.md) ^0.0.10
- [functional.js](https://npm.io/package/functional.js.md) ^0.6.10

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 0.0.15 (latest) — 2015-02-09
- 0.0.14 — 2014-12-13
- 0.0.13 — 2014-08-16
- 0.0.12 — 2014-08-11
- 0.0.11 — 2014-08-01
- 0.0.10 — 2014-06-26
- 0.0.9 — 2014-02-15
- 0.0.8 — 2014-02-09
- 0.0.6 — 2013-11-05
- 0.0.5 — 2013-11-05
- 0.0.4 — 2013-11-04
- 0.0.3 — 2013-11-04
- 0.0.2 — 2013-11-04

## README

# froute [![Build Status](https://travis-ci.org/leecrossley/froute.png?branch=master)](https://travis-ci.org/leecrossley/froute) [![npm version](https://badge.fury.io/js/froute.png)](https://npmjs.org/package/froute) [![Dependency Status](https://david-dm.org/leecrossley/froute/status.png)](https://david-dm.org/leecrossley/froute#info=dependencies)

**Simple and powerful routing for node with expressive matching.**

![froute](https://raw.github.com/leecrossley/froute/master/froute-logo.png)

## Getting started

```
npm install froute --save
```

```
var froute = require("froute");
```

## Examples

### Binding a froute template

```javascript
var template = "/apple/{type}",
    bindResult = froute.bind(template, callback);

expect(bindResult).toBeTruthy();
expect(froute.list().length).toEqual(1);
```

### Unbinding a froute template

```javascript
var unbound = froute.unbind(template);

expect(unbound.length).toEqual(1);
```

### Full example, bind and dispatch

```javascript
var template = "/apple/{type}/size/{size}",
    resultParams;

var bindResult = froute.bind(template, function(params) {
    resultParams = params;
});

var dispatchResult = froute.dispatch("/apple/gala/size/large");

expect(bindResult).toBeTruthy();
expect(dispatchResult).toBeTruthy();
expect(froute.list().length).toEqual(1);
expect(resultParams).toEqual({type:"gala",size:"large"});
```

---
_Source: https://npm.io/package/froute · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
