Skip to content

Commit

Permalink
minor changes in readme and comment section
Browse files Browse the repository at this point in the history
  • Loading branch information
mindactuate committed Jun 21, 2019
1 parent 2c146fa commit b0667c5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# patiently
Promise based API rate limit handler. Make your API client patient. A legal way to wait for API rate limit resets.
API rate limit handler. Make your API client patient. A legal way to wait for API rate limit resets.

[![npm version](https://img.shields.io/npm/v/patiently.svg?style=flat-square)](https://www.npmjs.com/package/patiently)
[![install size](https://packagephobia.now.sh/badge?p=patiently)](https://packagephobia.now.sh/result?p=patiently)
Expand Down
27 changes: 8 additions & 19 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,16 @@ const x = Infinity;
/**
* Waiter based on API rate limits you enter manually
*
* import patiently from "patiently";
*
* let options = {
* startWaitingCallback: {function}, // default is function(){}, calls a function if waiting necessary
* endWaitingCallback: {function}, // default is function(){}, calls a function after waiting
* waitingTickCallback: {function}, // default is function(){}, calls a function every tick
* msBetweenTwoCalls: {integer}, // default is 0 milliseconds (no waiting time between two calls)
* minutelyLimit: {integer}, // default is Infinity (no minutely limit set)
* hourlyLimit: {integer}, // default is Infinity (no hourly limit set)
* test: {boolean}, // default is false (if true, max waiting time is 5 secs)
* }
*
* var limitWaiter = waiter.LimitWaiter(options);
*
* let myApiCallFunction = async () => {
* limitWaiter.wait(function(){
* // your api call
* })
* }
* (Please read README in package to get further info)
*
* @param {Object} options
* @param {function} options.startWaitingCallback
* @param {function} options.endWaitingCallback
* @param {function} options.waitingTickCallback
* @param {Number} options.msBetweenTwoCalls
* @param {Number} options.minutelyLimit
* @param {Number} options.hourlyLimit
* @param {boolean} options.test
* @constructor
*/
function LimitWaiter(options) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "patiently",
"version": "2.1.2",
"version": "2.1.3",
"description": "API rate limit handler. Make your API client patient. A legal way to wait for API rate limit resets.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit b0667c5

Please sign in to comment.