# urls

> Enhancing urls for express.js.

Latest version **0.0.4** (published 2014-02-08) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2014-02-08 |
| First published | 2012-10-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nikolai Aleksandrenko |
| Maintainers | aleksandrenko |

## Links

- npm: https://www.npmjs.com/package/urls
- npm.io page: https://npm.io/package/urls

## Recent versions

- 0.0.4 (latest) — 2014-02-08
- 0.0.3 — 2012-10-13
- 0.0.2 — 2012-10-13
- 0.0.1 — 2012-10-13

## README

Enhancing urls for express.js.

## URLS.JS

With this module you can name used urls and call them by name in the template.

## Install

```js
urls = require('urls');
```

## Set urls:

Set urls like you set them without this module

```js
urls([ 
  { pattern: "/", view: routes.index, name: "index" },
  { pattern: "/api/user", view: user.list, name: "user", methods: ['get', 'post', 'put', 'delete'] },
  ], app);
```

*You have to pass the 'app' object so urls.js can move the urls and create dinamic helper.

## Use in templates 

Use url names in templates (jade example)

```js
 p url from urls.js module #{ url("index") }
```

If you are using handlebars the HTML code will look something like:
```js
<p>
  <a href="{{ url 'index' }}">home page</a>
</p>
```

You can send params like this (user:id):
```js
<p>
  <a href="{{ url 'users/' }}0035262">aleksansrenko</a>
</p>
```

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