# happyrestsort

> Express middleware to extract sort(asc/desc) from request

Latest version **1.1.0** (published 2015-08-07) · ISC license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2015-08-07 |
| First published | 2015-08-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yannick Saint Martino |
| Maintainers | yanninho |

## Links

- npm: https://www.npmjs.com/package/happyrestsort
- Repository: https://github.com/yanninho/happyRestSort
- Homepage: https://github.com/yanninho/happyRestSort#readme
- Issues: https://github.com/yanninho/happyRestSort/issues
- npm.io page: https://npm.io/package/happyrestsort

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) ^1.8.3

## Recent versions

- 1.1.0 (latest) — 2015-08-07
- 1.0.0 — 2015-08-07

## README

# happyRestSort
Express middleware which extract sort from request

# Example : 

	request : /test?sort=name,username&desc=username
	result : req.happyRest.sort =  ["name" , "-username"]

# install

npm install happyrestsort

# How to use ?

like all others Express middleware : 

## Application-level : 

var express = require('express')
  , happyRestSort = require('happyRestSort');

var app = express();

app.use(extractSort());

app.use('/test?sort=name,username&desc=username, function (req, res, next) {
  console.log('Sort:', req.happyRest.sort);
  next();
});

## Application-level : 

var express = require('express')
  , happyRestSort = require('happyRestSort');

var router = express.Router();

router.get('/test?sort=name,username&desc=username', extractSort(), function (req, res, next) {
	  console.log('Sort:', req.happyRest.sort);
	  next();
	})

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