diff --git a/index.d.ts b/index.d.ts index 81dd26a..82759cd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -762,8 +762,9 @@ declare class PProgress extends Promise { /** @param progress - Call this with progress updates. It expects a number between 0 and 1. - Multiple calls with the same number will result in only one `onProgress()` - event. Calling with a number lower than previously will be ignored. + Multiple calls with the same number will result in only one `onProgress()` event. + + Calling with a number lower than previously will be ignored. Progress percentage `1` is reported for you when the promise resolves. If you set it yourself, it will simply be ignored. */ diff --git a/license b/license index e7af2f7..fa7ceba 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/package.json b/package.json index 70daeba..0fd9863 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,11 @@ "description": "Create a promise that reports progress", "license": "MIT", "repository": "sindresorhus/p-progress", + "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, "engines": { "node": ">=8" diff --git a/readme.md b/readme.md index 59b4d54..65f5c33 100644 --- a/readme.md +++ b/readme.md @@ -4,14 +4,12 @@ Useful for reporting progress to the user during long-running async operations. - ## Install ``` $ npm install p-progress ``` - ## Usage ```js @@ -42,7 +40,6 @@ const progressPromise = new PProgress((resolve, reject, progress) => { })(); ``` - ## API ### instance = new PProgress(executor) @@ -58,7 +55,9 @@ Type: `Function` Call this with progress updates. It expects a number between 0 and 1. Multiple calls with the same number will result in only one `onProgress()` -event. Calling with a number lower than previously will be ignored. +event. + +Calling with a number lower than previously will be ignored. Progress percentage `1` is reported for you when the promise resolves. If you set it yourself, it will simply be ignored. @@ -147,7 +146,7 @@ const allProgressPromise = PProgress.all([ #### promises -Type: `Array` +Type: `Promise[]` Array of promises or promise-returning functions, similar to [p-all](https://github.com/sindresorhus/p-all). @@ -157,8 +156,8 @@ Type: `object` ##### concurrency -Type: `number`
-Default: `Infinity`
+Type: `number`\ +Default: `Infinity`\ Minimum: `1` Number of concurrently pending promises. @@ -167,7 +166,6 @@ To run the promises in series, set it to `1`. When this option is set, the first argument must be an array of promise-returning functions. - ## Related - [p-cancelable](https://github.com/sindresorhus/p-cancelable) - Create a promise that can be canceled