From bd42e029ef9000b756fc8087618f1519ccdb1128 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 7 Sep 2021 23:01:22 +0300 Subject: [PATCH] change readme and removed unused file --- .eslintignore | 3 +-- README.md | 15 +++++++++------ index.ts | 1 - 3 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 index.ts diff --git a/.eslintignore b/.eslintignore index 7224f51..82a9a73 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1 @@ -.eslintrc.js -index.ts \ No newline at end of file +.eslintrc.js \ No newline at end of file diff --git a/README.md b/README.md index c0b450a..89bcc9e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # nestjs-http-promise +[![npm version](https://img.shields.io/npm/v/nestjs-http-promise.svg?style=flat-square)](https://www.npmjs.org/package/nestjs-http-promise) ## description nestjs module that just doing little modification to the original and good **nestjs** http module. @@ -6,11 +7,13 @@ nestjs module that just doing little modification to the original and good **nes ## features * axios - the most used package for http requests in npm. - * promise based - most of us using the current http module and on every call do `.toPromise()` - because most of the time we do not need the features of observable. - * retries - one of the powerful features of observable is its ability to do in very simple way, - you can do it by just adding the retry operator, this package will provide you the same feature even in easier way, - just pass `{ retries: NUMBER_OF_RETRIES }` in the config of the http module. + * promise based - most of us using the current http module that uses observable which we don't use most of the time + and in order to avoid it were just calling `.toPromise()` every http call. + * retries - in many cases we will want to retry a failing http call. + with observable we could just add the retry operator (rxjs) but with promises we need to implement this logic ourselves. + this package will make it easy for you, just pass `{ retries: NUMBER_OF_RETRIES }` in the config of the http module. + **more details in the configuration section** + ## quick start ### installing Using npm: @@ -99,7 +102,7 @@ Note that in this example, the HttpConfigService has to implement HttpModuleOpti @Injectable() class HttpConfigService implements HttpModuleOptionsFactory { async createHttpOptions(): Promise { - const configurationData = await sonmeAsyncMethod(); + const configurationData = await someAsyncMethod(); return { timeout: configurationData.timeout, retries: 5, diff --git a/index.ts b/index.ts deleted file mode 100644 index cc80ecd..0000000 --- a/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './lib' \ No newline at end of file