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 🙏

© 2025 – Pkg Stats / Ryan Hefner

slim_request

v1.0.3

Published

Very slim request module for node v >=7 with 0 dependencies, for async/await requests(post,get,http,https,json,form-urlencoded).

Readme

slim_request

Description

Very slim request module for node v >=7 with 0 dependencies, for async/await requests(post,get,http,https,json,form-urlencoded).

Usage

###Install module

npm install slim_request

###Send request, return Promise. Params:

url - full address(http://github.com:80), string
host - host name (github.com), string
path - (/ekonomizer/slim_request), string
port - not required, int
data - request params, object
json - request params format, boolean, true by default, if false request with form-urlencoded params
https - protocol, boolean, true by default

const request = require('slim_request');
const url = "https://github.com:80/ekonomizer/slim_request"
try {
  let res = await request.send({method: 'get', url});
  console.log(res.body, res.statusCode, res.headers);
} catch(e) {
  throw(e);
}

###Custom params. You can set custom params:

const request = require('slim_request');
const params = {};
params.host = 'github.com';
params.path = '/ekonomizer/slim_request';
params.port = 80;
params.method = 'post';
pararms.json = false;
params.data = {somedata};

try {
  let res = await request.post(params);
  console.log(res.body, res.statusCode, res.headers);
} catch(e) {
  throw(e);
}

###Cache mode. You can enable cache mode(module save you request params, and they are available by alias)

let request = require('slim_request');

request.cacheMode(true);

const params = {};
params.host = 'github.com';
params.method = 'post';
params.data = {somedata};
params.alias = 'github slim request';

try {
  let res = await request.send(params);
  console.log(res.body, res.statusCode, res.headers)
} catch(e) {
  throw(e);
}

params = {};
params.data = {someOtherData}; // can send request without new params(with old)
params.alias = 'github slim request';
try {
  let res = await request.send(params);
  console.log(res.body, res.statusCode, res.headers)
} catch(e) {
  throw(e);
}

Or you can save requests, before send.

let request = require('slim_request');

request.cacheMode(true);

const params = {};
params.host = 'github.com';
params.method = 'post';
params.data = {somedata};
params.alias = 'github slim request';

request.saveRequest(params);
console.log(requests.savedRequests);

try {
  let res = await request.send({alias: 'github slim request'});
  console.log(res.body, res.statusCode, res.headers)
} catch(e) {
  throw(e);
}

###PreLoad requests from config. ####You can preload config vith request params to slim_request.

Important - config must have object requests with array request params.
let request = require('slim_request');
const config = {
    payments: {
        ios: {
            requests: [{
                alias: "ios_real",
                url: "https://buy.itunes.apple.com:443/verifyReceipt",
                json: false,
                method: "post"},
                {alias: "ios_test",
                url: "https://sandbox.itunes.apple.com:443/verifyReceipt",
                method: "post"}
            ]
        }
    }
}

request.cacheMode(true);
request.loadRequests(config);
console.log(request.savedRequests);

try {
  let res = await request.send({alias: 'ios_real', {data}});
  console.log(res.body, res.statusCode, res.headers)
} catch(e) {
  throw(e);
}

###Debug mode. You can enable debug mode, and set logger in module.

Params:
enableDebug - true by default
logger - console.log by default

const request = require('slim_request');
const enableDebug = true;
const logger = CustomUserLoggerWithMethodsDebugAndWarn();
request.debugMode(enableDebug, logger)

License MIT