# named-actions

> Map up names to connect style handlers

Latest version **0.2.0** (published 2014-04-12) · BSD license · 0 weekly downloads

## Install

```sh
npm install named-actions
pnpm add named-actions
yarn add named-actions
bun add named-actions
```

## 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.2.0 |
| Published | 2014-04-12 |
| First published | 2014-04-12 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel Pihlstrom |
| Maintainers | sciolist |
| Keywords | action, actions, routing |

## Links

- npm: https://www.npmjs.com/package/named-actions
- Repository: https://github.com/sciolist/node-named-actions
- Issues: https://github.com/sciolist/node-named-actions/issues
- npm.io page: https://npm.io/package/named-actions

## Dependencies (2)

- [connect](https://npm.io/package/connect.md) ^2.14.4
- [methods](https://npm.io/package/methods.md) ^0.1.0

## 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.2.0 (latest) — 2014-04-12

## README

named-actions
=============

Map up names to connect style handlers.

Install
-------

    $ npm install named-actions

Usage
-----

```js
var app = require('express')();
app.actions = require('named-actions')();

app.actions.get('root', function (req, res) {
  res.end('<a href="/login">Log in</a>');
});

app.actions.get('login', function (req, res) {
  res.end('Login page');
});

app.all('/:action', function (req, res, next) {
  var handler = app.actions.handler(req.params.action || 'root', req.method);
  handler(req, res, next);

  // alternatively:
  // app.actions.run(req.params.action || 'root', req.method, req, res, next);
});
app.listen(3000);
```

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