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

@advanced-rest-client/electron-request

v3.3.0

Published

The request engine for Advanced REST Client - Electron engine

Readme

Electron request

The HTTP engine for the Advanced REST Client application.

It works in the Electron's renderer process and allows to make a HTTP request resulting with detailed response.

The detailed response contains information about redirects and timings similar to the ones presented by Chrome Dev Tools.

Usage

The library contain two HTTP clients:

  • SocketRequest - ARC's original and own HTTP client. Operates directly on the socket.
  • ElectronRequest - A request engine using higher level Node's APIs

Both classes use the same configuration and produce the same output.

Installation

npm i -S @advanced-rest-client/electron-request

Socket request

Originally SocketRequest was develop for ARC Chrome Application as Chrome apps don't have access to low level request APIs and therefore the application was unable to produce detailed information about the request.

import { SocketRequest } from '@advanced-rest-client/electron-request';

const opts = {
  timeout: 30000,
  hosts: [{from: 'domain.com', to: 'other.com'}],
  followRedirects: true
};
const id = 'some-id';
const request = {
  url: 'http://api.domain.com',
  method: 'GET',
  headers: 'x-test: true'
};

const connection = new SocketRequest(request, id, opts);
request.on('load', (id, response, transport) => {});
request.on('error', (error, id, transport, response) => {});
try {
  await connection.send();
  console.log('Request message sent.');
} catch (cause) {
  // usually it means that the server is down or configuration is invalid (URL).
  console.error('Connection error', cause);
}

The transport is defined in @advanced-rest-client/arc-types as TransportRequest interface and describes the final message that has been sent to the endpoint. This includes all transformations applied to the request like added headers.

Native request

Electron application can access Node's APIs and therefore SocketRequest can be eventually replaced to reduce amount of code to maintain.

import { ElectronRequest } from '@advanced-rest-client/electron-request';

const opts = {
  timeout: 30000,
  hosts: [{from: 'domain.com', to: 'other.com'}],
  followRedirects: true
};
const id = 'some-id';
const request = {
  url: 'http://api.domain.com',
  method: 'GET',
  headers: 'x-test: true'
};

const connection = new ElectronRequest(request, id, opts);
request.on('load', (id, response, transport) => {});
request.on('error', (error, id, transport, response) => {});
try {
  await connection.send();
  console.log('Request message sent.');
} catch (cause) {
  // usually it means that the server is down or configuration is invalid (URL).
  console.error('Connection error', cause);
}

Running tests

Run the tests:

npm test