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

@wawjs/ngx-http

v21.3.1

Published

Angular HTTP and connectivity package from Web Art Work.

Readme

ngx-http

Angular HTTP and connectivity package from Web Art Work.

ngx-http extracts the HTTP client wrapper and network monitoring features from the older all-in-one package into a focused Angular package.

License

MIT

Installation

npm i --save ngx-http

Usage

import { provideNgxHttp } from 'ngx-http';

export const appConfig = {
	providers: [
		provideNgxHttp({
			http: {
				url: 'https://api.example.com',
				headers: {
					'X-App': 'docs',
				},
			},
			network: {
				endpoints: ['https://api.example.com/ping'],
				intervalMs: 30000,
				timeoutMs: 2500,
				goodLatencyMs: 300,
				maxConsecutiveFails: 3,
			},
		}),
	],
};

provideNgxHttp() registers the package config token and Angular HttpClient with fetch support.

Available Features

| Name | Description | | --- | --- | | HttpService | Shared HTTP layer with base URL, persistent headers, callback compatibility, and observable APIs | | NetworkService | Signal-based connectivity status and latency checks | | provideNgxHttp | Environment provider for HTTP and network configuration | | HttpConfig, NetworkConfig, NetworkStatus, Config | Public configuration and typing helpers |

Http Service

HttpService wraps Angular HttpClient with shared URL/header management and supports both legacy callback usage and observable flows.

Configuration and headers

  • setUrl(url: string)
  • removeUrl()
  • set(key: string, value: string | number | Array<string | number>)
  • header(key: string)
  • remove(key: string)

Requests

  • post(url, doc, callback?, opts?)
  • put(url, doc, callback?, opts?)
  • patch(url, doc, callback?, opts?)
  • delete(url, callback?, opts?)
  • get(url, callback?, opts?)

Lock helpers

  • clearLocked()
  • lock()
  • unlock()

Example:

import { HttpService } from 'ngx-http';

constructor(private httpService: HttpService) {}

ngOnInit() {
	this.httpService.setUrl('https://api.example.com');
	this.httpService.set('Authorization', 'Bearer token');
}

loadProfile() {
	this.httpService.get('/profile').subscribe(profile => {
		console.log(profile);
	});
}

Network Service

NetworkService monitors connectivity using Angular signals and periodic endpoint probes.

Public signals

  • status: good | poor | none
  • latencyMs: measured latency or null
  • isOnline: browser online state as a signal

Methods

  • recheckNow(): Promise<void>

Example:

import { NetworkService } from 'ngx-http';

constructor(private networkService: NetworkService) {}

async ngOnInit() {
	await this.networkService.recheckNow();
	console.log(this.networkService.status());
}

AGENTS.md

Copy this into your project AGENTS.md when using ngx-http:

- This project uses `ngx-http`, an Angular utility library for API calls and network monitoring.
- Prefer bootstrapping with `provideNgxHttp({...})` in application providers.
- Put shared API base URL, default headers, and network probe settings in `provideNgxHttp()` instead of scattering them across components.
- Prefer `HttpService` for API calls and shared header/base URL handling before introducing another app-specific wrapper.
- Prefer `NetworkService` for connectivity state and latency checks before adding duplicate online/offline utilities.
- Keep SSR-safe behavior intact. Do not add unguarded browser-only network logic when `ngx-http` already provides the needed abstraction.