npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ridder/request

v1.0.1

Published

Request service ===== 1. [Description](#description) 2. [Installation](#installation) 3. [Usage](#usage) 4. [Methods](#methods) 5. [Git repository](#git) 6. [Run tests](#testing) 7. [Build](#build) 8. [Publish to npm](#publish) 9. [Version](#version)

Readme

Request service

  1. Description
  2. Installation
  3. Usage
  4. Methods
  5. Git repository
  6. Run tests
  7. Build
  8. Publish to npm
  9. Version

1. Description

RequestService is an extension of the HttpClient service which is implementing the error handling method on top of get() and post() methods

2. Installation

Install the module into your application and save it as a dev dependency in your package.json file

npm install @ridder/request --save-dev

3. Usage

In order to use the RequestService you have to:

  1. Include the RequestModule in the app's imports list:
      import { RequestModule } from '@ridder/request';
      //...
      imports: [
        //...
        RequestModule
        //...
      ]
  2. inject the RequestService via dependency injection into your services/components and use it:
     import { RequestService } from '@ridder/request';
     //...
     export class AppComponent implements OnInit{
        
       constructor(private request: RequestService) {
       }
        
       ngOnInit() {
         this.request.get('/assets/test.json').subscribe((response)=>{
           console.log('Response:', response);
         })
       }
     }

4. Methods

get(url: string, errorParams?: ResponseError, httpOptions: any = {}): Observable

Performs an http get request.

Parameters:
url - url to be requested.
errorParams - optional default error parameters and data which should be returned back in case of an error.
Structure of the object:

{
  serviceName?: string;
  operation?: string;
  result?: T;
}

where T is the type of the data which should be returned back.
httpOptions - optional additional http options (headers etc.) used with the request.

Return:
Method returns an Observable<T> which contains the response data coming from the server, where T is the type of the data which should be returned back.

post<D, R>(url: string, data: D, errorParams?: ResponseError, httpOptions: any = {}): Observable

Performs an http get request.

Parameters:
url - url to be requested.
data - data to be send to the server via post request. D is the type of data to be sent.
errorParams - optional default error parameters and data which should be returned back in case of an error.
Structure of the object:

{
  serviceName?: string;
  operation?: string;
  result?: R;
}

where R is the type of the data which should be returned back.
httpOptions - optional additional http options (headers etc.) used with the request.

Return:
Method returns an Observable<R> which contains the response data coming from the server, where R is the type of the data which should be returned back.

private handleError(serviceName = '', operation = '', result = {} as T)

Handle the error and throws and error observable with the expected result.

Parameters:
serviceName - optional name of the service to be logged within the error message.
operation - optional operation to be logged within the error message.
result - optional expected result which should be returned back as an error observable.

Return:
Method returns an error Observable<T> which contains the result of type T.

5. Git repository

https://github.com/dtxprs/request

6. Run tests

To run the unit tests, use this command:

ng test --code-coverage --project=request

Current test coverage is 100%!

7. Build

To build the final package run this command:

ng build request

The build process will generate the packed sources into the dist folder.

8. Publish to npm

To publish the new version to npm, go into the dist folder:

cd ./dist/request

and publish it to npm:

npm publish --access public

9. Version

1.0.1