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

@mondart/nestjs-common-module-request

v3.1.9

Published

HTTP request module and service for NestJS.

Readme

@mondart/nestjs-common-module-request

A small HTTP client wrapper for NestJS: a RequestModule that registers a global RequestService built on @nestjs/axios, for calling other HTTP services with a bearer token attached.

Registration

import { RequestModule } from '@mondart/nestjs-common-module-request';

@Module({
  imports: [RequestModule],
})
export class AppModule {}

RequestModule is @Global(), so RequestService is available for injection anywhere without re-importing the module.

RequestService

import { RequestService, HttpMethods } from '@mondart/nestjs-common-module-request';

constructor(private readonly requestService: RequestService) {}

const user = await this.requestService.get({
  path: 'https://api.example.com/users/1',
  token: accessToken,
});

await this.requestService.post({
  path: 'https://api.example.com/users',
  body: { name: 'Ada' },
  token: accessToken,
});

await this.requestService.patch({ path: '...', body: { name: 'Ada L.' } });
await this.requestService.remove({ path: 'https://api.example.com/users/1' });

post/get/patch/remove are convenience wrappers around send with method fixed to the matching HttpMethods value. path is used as the full request URL, token (if given) is sent as Authorization: Bearer <token>, and params, if given, is appended to path as-is (e.g. 'foo=1&bar=2') rather than being serialized from an object.

send resolves to result.data on success. On failure it does not throw — the caught error is returned as the resolved value instead, so callers must check the result shape rather than relying on a rejected promise or a try/catch.

const result = await this.requestService.get({ path: '...' });
if (result instanceof Error) {
  // handle failure
}

sendRaw

sendRaw returns the full Axios response instead of just the body, and supports resolving path against a configured base URL:

await this.requestService.sendRaw({
  method: HttpMethods.GET,
  path: '/users/1',
  isAdditionalPath: true, // path is appended to config `app.baseUrl`
  token: accessToken,
});

When isAdditionalPath is true, the request URL is configService.get('app.baseUrl') + path; otherwise path is used as the full URL, same as send.