# siren-mount

> Mount other Koa applications or middleware to a given pathname pattern.

Latest version **1.0.0** (published 2015-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install siren-mount
pnpm add siren-mount
yarn add siren-mount
bun add siren-mount
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-01-15 |
| First published | 2015-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | texvnars |
| Keywords | koa, middleware, mount, mounting |

## Links

- npm: https://www.npmjs.com/package/siren-mount
- Repository: https://github.com/TerenceZ/siren-mount
- Issues: https://github.com/TerenceZ/siren-mount/issues
- npm.io page: https://npm.io/package/siren-mount

## Dependencies (3)

- [debuglog](https://npm.io/package/debuglog.md) ^1.0.1
- [koa-compose](https://npm.io/package/koa-compose.md) ^2.3.0
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^1.0.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-01-15

## README

# An mounting middleware for [koa](https://github.com/koajs/koa)

[![Build Status](https://secure.travis-ci.org/TerenceZ/siren-mount.png)](http://travis-ci.org/TerenceZ/siren-mount)

siren-mount is modified from the [koa-mount](https://github.com/koajs/mount) by:
* Support for express path using [path-to-regexp](https://github.com/pillarjs/path-to-regexp).

## Installation

```js
npm install --save siren-mount
```

## Usage

The usage is the same as [koa-mount](https://github.com/koajs/mount), except:

## Regular Expression Path

You can use regular expression as prefix:

```js
var app = koa();
var router = koa();

app.use(mount(/\/([^\/]+)\/?/i, function *() {
  // Matches /abc, /abc/, /abcdadc/dsd
}));
```

## Parameter Access

You can use `ctx.params` to access the URL parameters:

```js
var app = koa();
var router = koa();

app.use('/:id', function *() {
  console.log(this.params.id);
}));
```

## License

  MIT

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