Skip to content

Commit 3009fe0

Browse files
author
John Edward
committed
fix default export from build
1 parent f12a399 commit 3009fe0

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,49 @@
22

33
> Uses stack and Async/Await approach
44
5-
Use this for your routes if you need those concurrent requests to behave synchronously. If you don't need every request to be queued for a route (unique requests), we can do that too!
5+
Use this for your express routes if you need those concurrent requests to behave synchronously. If you don't need every request to be queued for a route (unique requests), we can do that too!
6+
7+
## Installation
8+
9+
```bash
10+
> npm install express-request-queue --save
11+
```
12+
13+
## Usage
14+
15+
```js
16+
import RequestQ from 'express-request-queue';
17+
18+
const q = RequestQ();
19+
20+
route.post('/book', q.run(async (req, res, next) {
21+
await longRunningTask();
22+
res.json({});
23+
}));
24+
```
25+
26+
### Group queues
27+
28+
Grouping queues base on your request payload:
29+
30+
```js
31+
const config = {
32+
unique: true, // by setting this to true, queues are grouped by thier identifiers
33+
from: 'body', // what type of req payload the identifier is located from
34+
name: 'id' // name of the field to reference from
35+
}
36+
37+
const q = RequestQ(config);
38+
```
39+
40+
## License
41+
42+
MIT
43+
44+
## Maintainer
45+
46+
[John Edward Escuyos](http://github/jeescu)
47+
48+
## Contributor
49+
50+
[Jeserie Golo](http://github/kenjoe)

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ class RequestQueue {
116116
}
117117
}
118118

119-
export default RequestQueue;
119+
module.exports = RequestQueue;

0 commit comments

Comments
 (0)