gitwtfhub

wtf is promise-core?

request/promise-core — explained in plain English

Analysis updated 2026-08-08 · repo last pushed 2021-05-21

20JavaScriptAudience · developerComplexity · 2/5DormantSetup · moderate

TL;DR

Adds promise-based syntax (.then/.catch) to the popular JavaScript "request" library, so you can write cleaner HTTP calls without nested callbacks. Mostly used as the engine behind other wrapper libraries.

Mindmap

mindmap
  root((repo))
    What it does
      Adds promises to request
      Replaces callbacks
      Configurable promise methods
    Tech stack
      JavaScript
      Node.js
      Lodash
    Use cases
      Clean HTTP calls
      Base for wrapper libraries
      Custom promise setups
    Audience
      JavaScript developers
      Library authors
    Notes
      Security maintained
      Designed for future request

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Write cleaner HTTP request code using .then() and .catch() instead of nested callbacks.

REASON 2

Build a custom request-promise wrapper paired with a specific promise library.

REASON 3

Understand how popular request-promise libraries work under the hood.

What's in the stack?

JavaScriptNode.jsnpmLodash

How it stacks up

request/promise-coreaaronz345/athena-personal-academic-pagealana72212/akamai-vm
Stars202020
LanguageJavaScriptJavaScriptJavaScript
Last pushed2021-05-21
MaintenanceDormant
Setup difficultymoderatemoderatehard
Complexity2/52/55/5
Audiencedeveloperresearcherresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires the request library and a compatible ES6 promise implementation, plus careful configuration to avoid double-patching.

The explanation does not mention a specific license for this repository.

Wtf does this do

When you write JavaScript code that needs to fetch data from a website or API, you typically use a library called "request" to make the HTTP call. Traditionally, that library used callbacks, a style of programming where you pass a function to run once the data arrives. Many modern JavaScript developers prefer "promises," a cleaner pattern that lets you chain actions together with .then() and handle errors with .catch(). This package, request-promise-core, adds that promise-based interface to the request library. At a practical level, the package patches the request library so that calling it returns a promise object instead of requiring a callback. You configure it by passing in your preferred promise implementation (the README notes it should be ES6-compatible), along with a list of which promise methods you want exposed, such as then, catch, and promise. Once configured, you can write something like request('http://example.com').then(handleData).catch(handleError) instead of nesting callback functions. Most developers will not use this package directly. It serves as the shared engine behind several more user-friendly wrapper libraries, request-promise, request-promise-native, request-promise-bluebird, and request-promise-any, each of which pairs this core logic with a specific promise implementation. You would only install and configure request-promise-core yourself if you had very specific requirements that those wrappers don't cover, since the manual setup involves some careful handling of how the request library is loaded to avoid accidentally patching it twice. The project has been maintained with an eye on security, with several releases specifically bumpging its lodash dependency to address known vulnerabilities. The README also notes that it was designed to be compatible with a future version of the request library, though that next version is still in alpha.

Yoink these prompts

Prompt 1
Show me how to configure request-promise-core with the native ES6 Promise implementation so I can call request('http://example.com').then(handleData).catch(handleError).
Prompt 2
Explain the manual setup steps for request-promise-core, including how to load the request library to avoid accidentally patching it twice.
Prompt 3
Compare using request-promise-core directly versus using request-promise-native, and tell me when I would choose the direct approach.
Prompt 4
Walk me through migrating a callback-based request call to promise-based syntax using request-promise-core.

Frequently asked questions

wtf is promise-core?

Adds promise-based syntax (.then/.catch) to the popular JavaScript "request" library, so you can write cleaner HTTP calls without nested callbacks. Mostly used as the engine behind other wrapper libraries.

What language is promise-core written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js, npm.

Is promise-core actively maintained?

Dormant — no commits in 2+ years (last push 2021-05-21).

What license does promise-core use?

The explanation does not mention a specific license for this repository.

How hard is promise-core to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is promise-core for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.