@req-json/rate-limit

1.0.2 • Public • Published

@req-json/rate-limit

npm bundle size npm downloads license

github travis coverage

Rate limit middleware for req-json.

Installation

NPM

npm install @req-json/rate-limit --save
import ReqJSON from 'req-json';
import reqJSONRateLimit from '@req-json/rate-limit';

const reqJSON = new ReqJSON();
reqJSON.use(reqJSONRateLimit());

Browser

Direct <script> include window.reqJSONRateLimit

<script src="https://cdn.jsdelivr.net/npm/@req-json/rate-limit@1"></script>

Options

Rate limit middleware options and defaults.

reqJSON.use(reqJSONRateLimit({
  methods: [ // request methods to apply rate limit
    'POST',
    'PUT'
  ],
  frequency: 1000 // request only once in 1000ms
}));

Package Sidebar

Install

npm i @req-json/rate-limit

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

13.3 kB

Total Files

10

Last publish

Collaborators

  • cweili