Skip to content

Commit

Permalink
docs: re-order sections of the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gamemaker1 committed Jan 12, 2022
1 parent 7adc756 commit 9db7df0
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ This module was designed to only handle the basics and didn't even support
external stores initially. These other options all are excellent pieces of
software and may be more appropriate for some situations:

- [rate-limiter-flexible](https://www.npmjs.com/package/rate-limiter-flexible)
- [express-brute](https://www.npmjs.com/package/express-brute)
- [rate-limiter](https://www.npmjs.com/package/express-limiter)
- [`rate-limiter-flexible`](https://www.npmjs.com/package/rate-limiter-flexible)
- [`express-brute`](https://www.npmjs.com/package/express-brute)
- [`rate-limiter`](https://www.npmjs.com/package/express-limiter)

## Installation

Expand Down Expand Up @@ -189,17 +189,7 @@ it does.
For more information about the `trust proxy` setting, take a look at the
[official Express documentation](https://expressjs.com/en/guide/behind-proxies.html).

## Request API

A `request.rateLimit` property is added to all requests with the `limit`,
`current`, and `remaining` number of requests and, if the store provides it, a
`resetTime` Date object. These may be used in your application code to take
additional actions or inform the user of their status.

The property name can be configured with the configuration option
`requestPropertyName`

## Configuration options
## Configuration

### `windowMs`

Expand Down Expand Up @@ -376,16 +366,16 @@ By default, the [memory store](source/memory-store.ts) is used.

Available data stores are:

- [memory-store](source/memory-store.ts): _(default)_ Simple in-memory option.
- [`memory-store`](source/memory-store.ts): _(default)_ Simple in-memory option.
Does not share state when app has multiple processes or servers.
- [rate-limit-redis](https://npmjs.com/package/rate-limit-redis): A
- [`rate-limit-redis`](https://npmjs.com/package/rate-limit-redis): A
[Redis](http://redis.io/)-backed store, more suitable for large or demanding
deployments.
- [rate-limit-memcached](https://npmjs.org/package/rate-limit-memcached): A
- [`rate-limit-memcached`](https://npmjs.org/package/rate-limit-memcached): A
[Memcached](https://memcached.org/)-backed store.
- [rate-limit-mongo](https://www.npmjs.com/package/rate-limit-mongo): A
- [`rate-limit-mongo`](https://www.npmjs.com/package/rate-limit-mongo): A
[MongoDB](https://www.mongodb.com/)-backed store.
- [precise-memory-rate-limit](https://www.npmjs.com/package/precise-memory-rate-limit) -
- [`precise-memory-rate-limit`](https://www.npmjs.com/package/precise-memory-rate-limit) -
A memory store similar to the built-in one, except that it stores a distinct
timestamp for each IP rather than bucketing them together.

Expand Down Expand Up @@ -491,6 +481,16 @@ class SomeStore implements Store {
export default SomeStore
```

## Request API

A `request.rateLimit` property is added to all requests with the `limit`,
`current`, and `remaining` number of requests and, if the store provides it, a
`resetTime` Date object. These may be used in your application code to take
additional actions or inform the user of their status.

The property name can be configured with the configuration option
`requestPropertyName`

## Instance API

### `resetKey(key)`
Expand Down

0 comments on commit 9db7df0

Please sign in to comment.