# waypoint

> Waypoint provides browser and server side routing

Latest version **0.2.8** (published 2012-02-09) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score; declining downloads.

## Facts

| | |
|---|---|
| Version | 0.2.8 |
| Published | 2012-02-09 |
| First published | 2012-01-11 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ~0.6.3 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Luke Morton |
| Maintainers | drpheltright |

## Links

- npm: https://www.npmjs.com/package/waypoint
- Repository: https://github.com/DrPheltRight/waypoint
- Homepage: http://github.com/DrPheltRight/waypoint
- npm.io page: https://npm.io/package/waypoint

## Recent versions

- 0.2.8 (latest) — 2012-02-09
- 0.2.7 — 2012-02-09
- 0.2.6 — 2012-01-21
- 0.2.5 — 2012-01-21
- 0.2.4 — 2012-01-21
- 0.2.2 — 2012-01-12
- 0.2.1 — 2012-01-11
- 0.2.0 — 2012-01-11

## README

# Waypoint

A CoffeeScript URI router for use anywhere. The main aim of
waypoint is to decouple the URI parsing from any kind of
automatic dispatching.

For example Director is a JS router that works both client
side and server side. It listens in the browser for URI
changes and runs the route callbacks for any matching routes.
On node it can respond to a Request object.

For waypoint I didn't want to include this behaviour so that
you are free to use what ever you want. In the browser you
could use History.js. On the server you could use a completely
custom solution. It's up to you.

## In the browser

First you'll want to clone the git repository like so:

	git clone git://github.com/DrPheltRight/waypoint.git
	cd waypoint

You'll find the latest development version of Waypoint for the
browser in the `dist` directory. You can either use this or
build your own like so:

	cake build

If you wanted to build the master version you can simply
checkout that branch.

Now you can use the browser edition as shown in
`examples/browser`. It is AMD, CommonJS and global
compatible so include it how you wish.

## On the server

You can use NPM to install waypoint like so:

	npm install waypoint

This will install it into `node_modules` within your current
directory. *You probably wouldn't want to use waypoint
globally.*

Once you have waypoint installed you can require it like
normal:

``` js
var waypoint = require('waypoint'),
	router = new Waypoint.Router;

router.routeMap({
	'/' : function () {
		console.log('Index');
	},
	'/:name': function (name) {
		console.log('Hello', name);
	},
	'POST /process': function () {
		console.log('POST request');
	}
})

router.dispatch('/');
router.dispatch('/Bob');
router.dispatch('POST', '/process');
```

## Contributing

If you wish to hack on waypoint clone the development branch
and use `npm link` to ensure your working directory is
symlinked into node's include path.

## Author

Luke Morton a.k.a. DrPheltRight

## License

MIT

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