{"id":15365646,"url":"https://github.com/tunnckocore/express-better-ratelimit","last_synced_at":"2025-04-15T09:52:56.138Z","repository":{"id":22486406,"uuid":"25825642","full_name":"tunnckoCore/express-better-ratelimit","owner":"tunnckoCore","description":"Express.js request rate limiter","archived":false,"fork":false,"pushed_at":"2017-07-20T21:11:16.000Z","size":22,"stargazers_count":10,"open_issues_count":8,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T07:42:52.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://j.mp/1stW47C","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tunnckoCore.png","metadata":{"files":{"readme":"readme.md","changelog":"history.md","contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-27T15:29:51.000Z","updated_at":"2017-04-15T21:41:19.000Z","dependencies_parsed_at":"2022-08-21T06:31:06.683Z","dependency_job_id":null,"html_url":"https://github.com/tunnckoCore/express-better-ratelimit","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fexpress-better-ratelimit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fexpress-better-ratelimit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fexpress-better-ratelimit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fexpress-better-ratelimit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tunnckoCore","download_url":"https://codeload.github.com/tunnckoCore/express-better-ratelimit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048713,"owners_count":21204305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T13:15:25.356Z","updated_at":"2025-04-15T09:52:56.119Z","avatar_url":"https://github.com/tunnckoCore.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# better-ratelimit [![NPM version][npmjs-shields]][npmjs-url] [![Build Status][travis-img]][travis-url] [![Dependency Status][depstat-img]][depstat-url] [![Coveralls][coveralls-shields]][coveralls-url]\n\u003e [Express.js][express-url] request rate limit middleware by IP with MemoryStore\n\n\n### [upcoming v2](https://github.com/tunnckoCore/express-better-ratelimit/milestones/v2) soon\n\n## Install [![Nodei.co stats][npmjs-install]][npmjs-url]\n\u003e Install with [npm](https://npmjs.org)\n\n```\n$ npm install express-better-ratelimit\n$ npm test\n```\n\n**This package follows [ferver](https://github.com/jonathanong/ferver)**\n\u003e Please read [history.md](history.md) for more info!\n\n- option `message_429` deprecated **\u003e=v1.1.x**, instead use `accessLimited`\n- option `message_403` deprecated **\u003e=v1.1.x**, instead use `accessForbidden`\n\n\n## Usage\n\u003e Some demo example which is exactly `example.js`\n\n```js\nvar express = require('express');\nvar limit = require('./index');\n\nvar app = express();\n\napp.use(limit({\n  duration: 30000, //30 seconds\n  max: 5\n  //blackList: ['127.0.0.1']\n}));\n\napp.use(function helloWorld(req, res, next) {\n  res.set('Content-Type', 'text/plain');\n  res.status(200).send('Hello world');\n  next();\n});\n\nvar port = process.env.PORT || 3333;\napp.listen(port);\nconsole.log('Express server start listening on port %s', port);\nconsole.log('Type few times: curl -i http://localhost:%s', port);\n```\n\n\n## [.expressBetterRatelimit](index.js#L32)\n\u003e With options through init you can control black/white lists, limit per ip and reset interval.\n\n* `[options]` **{Object}**\n  - `duration` **{Integer}** Limit duration in milliseconds, default `1000 * 60 * 60 * 1` (1 hour)\n  - `whiteList` **{Array}** All ips that won't be limited, default `empty array`\n  - `blackList` **{Array}** All ips that always be limited and 403, default `empty array`\n  - `accessLimited` **{String}** Message for all requests after limit, default `429: Too Many Requests.`\n  - `accessForbidden` **{String}** Message for limited/forbidden, default `403: This is forbidden area for you.`\n  - `max` **{Integer}** Max requests per ip, default `500`\n  - `env` **{Boolean}** Manage enviroment, for tests will use `x-koaip` header, default `null`\n* `return` **{Function}**\n\n\n## Authors \u0026 Contributors \n**Charlike Make Reagent** [![author tips][author-gittip-img]][author-gittip]\n+ [gittip/tunnckoCore][author-gittip]\n+ [github/tunnckoCore][author-github]\n+ [twitter/tunnckoCore][author-twitter]\n+ [npmjs/tunnckoCore][author-npmjs]\n\n\n## License [![MIT license][license-img]][license-url]\nCopyright (c) 2014 [Charlike Make Reagent][author-website], [contributors](https://github.com/tunnckoCore/express-better-ratelimit/graphs/contributors).  \nReleased under the [`MIT`][license-url] license.\n\n[npmjs-url]: http://npm.im/express-better-ratelimit\n[npmjs-shields]: http://img.shields.io/npm/v/express-better-ratelimit.svg\n[npmjs-install]: https://nodei.co/npm/express-better-ratelimit.svg?mini=true\n\n[coveralls-url]: https://coveralls.io/r/tunnckoCore/express-better-ratelimit?branch=master\n[coveralls-shields]: https://img.shields.io/coveralls/tunnckoCore/express-better-ratelimit.svg\n\n[license-url]: https://github.com/tunnckoCore/express-better-ratelimit/blob/master/license.md\n[license-img]: http://img.shields.io/badge/license-MIT-blue.svg\n\n[travis-url]: https://travis-ci.org/tunnckoCore/express-better-ratelimit\n[travis-img]: https://travis-ci.org/tunnckoCore/express-better-ratelimit.svg?branch=master\n\n[depstat-url]: https://david-dm.org/tunnckoCore/express-better-ratelimit\n[depstat-img]: https://david-dm.org/tunnckoCore/express-better-ratelimit.svg\n\n[author-gittip-img]: http://img.shields.io/gittip/tunnckoCore.svg\n[author-gittip]: https://www.gittip.com/tunnckoCore\n[author-github]: https://github.com/tunnckoCore\n[author-twitter]: https://twitter.com/tunnckoCore\n\n[author-website]: http://www.whistle-bg.tk\n[author-npmjs]: https://npmjs.org/~tunnckocore\n\n[express-url]: https://github.com/strongloop/express\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fexpress-better-ratelimit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftunnckocore%2Fexpress-better-ratelimit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fexpress-better-ratelimit/lists"}