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

@quanticdigit/web-services

v1.0.2

Published

Typed reads and writes against HTTP services: response envelope, model reconstruction and error contracts.

Downloads

499

Readme

@quanticdigit/web-services

Typed reads and writes against HTTP services: response envelope, model reconstruction and error contracts.

Two base classes, same shape, different other end:

  • BaseService — for services that answer with the QuanticDigit envelope { result, output, errors };
  • EasyServiceBase — for services that return the object directly and report failures with HTTP status codes.

Both give you the same eight verbs with the same signatures, so moving between them does not change how you write a call.

Install

npm install @quanticdigit/web-services @quanticdigit/web-model

Peer dependencies: @angular/common, @angular/core, rxjs, @quanticdigit/web-model.

The one thing to wire

Both classes resolve endpoints from a table your product owns. Declare it once, in the root injector:

import { ENDPOINT_TABLE } from '@quanticdigit/web-services';

providers: [
  { provide: ENDPOINT_TABLE, useValue: environment.endpoint },
]

The table is { name, endpoint }[]. Forget it and the first call tells you which key it was looking for, not just that a token was missing.

A service

@Injectable({ providedIn: 'root' })
export class UserService extends BaseService {
  constructor(service: WebApiService) { super(service); }

  byId(id: number, errors: IErrorInfoAppender | null = null): Observable<User> {
    return this.get<User>(User, this.formatEndpoint('user', id), errors);
  }
}

getEndpoint appends its arguments to the address; formatEndpoint substitutes {0}, {1} … and URL-encodes them.

Errors are never swallowed

If you pass an IErrorInfoAppender, failures are handed to it and the stream completes.

If you pass nothing, the error propagates to your subscriber. There is no silent mode: an operation that fails without anyone to report it must not look like an operation that returned nothing.

service.byId(7).subscribe({
  next: (user) => …,
  error: (err) => …,   // reached when no appender was given
});

The three outcomes are siblings, so the order of your instanceof checks does not matter:

WebApiException
├── WebApiFatal      the service could not answer
├── WebApiError      the request was understood and refused
└── WebApiWarning<T> succeeded with warnings — carries the result

Plain REST services

EasyServiceBase reads the response body as the result. Errors are built from the HTTP response: id is the status code, message is the response body or its status text, and isBusiness is always false — without an envelope there is no way to know whether a refusal is a domain rule, and guessing from a 409 would be inventing it.

The family

web-utils, web-model, web-services, web-component and web-errors are released together and always share the same version. Install them at the same version.

License

Commercial. See LICENSE.txt in the package.