npm

Join us for the upcoming webinar, "Enterprise JavaScript done right: the tools you love, the security you need."Sign up here »

@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
}));

install

npm i @req-json/rate-limit

Downloadsweekly downloads

17

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability