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

@rdfc/http-utils-processor-ts

v1.0.2

Published

HTTP util functions to be used within RDF-Connect

Readme

http-utils-processor-ts

Build and test Coverage Status npm

RDF-Connect Typescript processors for handling HTTP operations. The main processor fetches a URL and writes the response to an output channel. It supports configurable HTTP methods, headers, authentication, and scheduling via cron expressions.


Usage

Installation

npm install
npm run build

Or install from NPM:

npm install @rdfc/http-utils-processor-ts

Pipeline Configuration Example

@prefix rdfc: <https://w3id.org/rdf-connect#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.

### Import the processor definitions
<> owl:imports <./node_modules/@rdfc/http-utils-processor-ts/processors.ttl>.

### Define the channels your processor needs
<out> a rdfc:Writer.

### Define and configure the processor
<fetcher> a rdfc:HttpFetch;
    rdfc:url "https://example.org/api/data";
    rdfc:writer <out>;
    rdfc:options [
        rdfc:method "GET";
        rdfc:headers "Authorization: Bearer TOKEN";
        rdfc:acceptStatusCodes "200-300";
        rdfc:closeOnEnd true;
        rdfc:timeOutMilliseconds 5000;
        rdfc:cron "*/5 * * * *";
        rdfc:runOnInit true;
        rdfc:errorsAreFatal true;
        rdfc:outputAsBuffer false;
        rdfc:auth [
            rdfc:type "basic";
            rdfc:username "user";
            rdfc:password "pass"
        ]
    ].

Configuration

Parameters of rdfc:HttpFetch:

  • rdfc:url (string, required): URL(s) to fetch. Can be a single string or an array of strings.
  • rdfc:writer (rdfc:Writer, required): Output channel to write the fetched response.
  • rdfc:options (rdfc:HttpFetchOptions, optional): Optional settings including method, headers, timeout, authentication, cron, and more.

Parameters of rdfc:HttpFetchOptions:

  • rdfc:method (string, optional): HTTP method (default: GET).
  • rdfc:headers (string[], optional): Array of header strings (default: []).
  • rdfc:acceptStatusCodes (string[], optional): List of accepted status codes or ranges, e.g., ["200", "201-300"] (default: ["200-300"]).
  • rdfc:closeOnEnd (boolean, optional): Whether to close the writer after execution. Default depends on cron: true if no cron, false otherwise.
  • rdfc:timeOutMilliseconds (integer, optional): Maximum wait time for a response before throwing a timeout error.
  • rdfc:auth (rdfc:HttpFetchAuth, optional): Authentication configuration (see below).
  • rdfc:cron (string, optional): Cron expression to schedule repeated executions.
  • rdfc:runOnInit (boolean, optional): Run immediately upon initialization if cron is set (default: false).
  • rdfc:errorsAreFatal (boolean, optional): Exit on fetch errors (default: true).
  • rdfc:outputAsBuffer (boolean, optional): Whether the response is returned as a buffer (default: false).

Authentication (rdfc:HttpFetchAuth)

Supported types:

HTTP Basic Authentication

  • rdfc:type: "basic"
  • rdfc:username: Username string
  • rdfc:password: Plaintext password

OAuth 2.0 Password Grant

  • rdfc:type: "oauth2"
  • rdfc:endpoint: URL of the OAuth 2.0 server
  • rdfc:username: Username string
  • rdfc:password: Plaintext password

Credentials are only sent to the authentication endpoint, not to the target URL.


Errors

All errors thrown are of type HttpFetchError and include a HttpUtilsErrorType enum describing the error nature.


Tests

Use Node.js to run tests:

npm run build
npm test

Some tests interact with real servers and may require credentials via a .env file:

# OAuth 2.0 Password Grant
RINF_USERNAME=
RINF_PASSWORD=

# HTTP Basic Auth
WoRMS_USERNAME=
WoRMS_PASSWORD=

# Set to true to enable real requests
BLUE_BIKE=true

Additional test information can be found here.