Registry / http-networking / promised-http

promised-http

JSON →
library0.0.2jsnpmunverified

Promised-http is an early, proof-of-concept HTTP library for Node.js that wraps the native `http` module with promises (specifically the `q` library). Version 0.0.2 is the latest and only release, with no updates since 2011. It predates modern promise patterns and ES6 Promises, making it obsolete. Key differentiators: one of the first promise-based HTTP clients, but now superseded by `axios`, `node-fetch`, and `got`. Not recommended for new projects.

npm install promised-http
INSTALL
IMPORT
SIG · PROMISED-HTTP
P
promised-http
http-networkingjavascriptv0.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

request
import { request } from 'promised-http';
const request = require('promised-http').request;
The library exports a single `request` function. CommonJS require works if the package is consumed as CJS, but ESM is preferred for modern projects.
default import
import http from 'promised-http';
const http = require('promised-http');
The default import gives access to the `request` function directly. Using `http.request()` is also valid.
get
import { get } from 'promised-http';
const get = require('promised-http').get;
The library does not export a `get` function; it only exports `request`. This is a common mistake.

Demonstrates basic GET request using the promise-based `request` function from promised-http. Note: The library is outdated and not recommended for production.

import http from 'promised-http'; const options = { host: 'api.example.com', path: '/data', method: 'GET' }; http.request(options) .then(response => { console.log('Status:', response.statusCode); return response.body; }) .then(body => console.log('Body:', body)) .catch(err => console.error('Error:', err));
Debug
Known issues
deprecatedPackage is unmaintained since 2011. Use modern alternatives like `axios`, `node-fetch`, or `got`.
fix
Replace with a maintained HTTP client library.
affects: 0.0.2
breakingUses `q` promises, not ES6 Promises. Will not work with native `async/await` without conversion.
fix
Convert `q` promises to native Promises using `Q()` or upgrade to a library with native promises.
affects: >=0.0.0
gotchaThe `request` function expects options in Node.js `http.request` format (e.g., `host`, `port`, `path`). Not compatible with URL strings.
fix
Use the `http.request` options object; do not pass a URL string.
affects: >=0.0.0
gotchaNo built-in support for HTTPS. Requires separate handling or using Node's https module directly.
fix
Use Node's `https` module or a modern library that handles both HTTP and HTTPS.
affects: >=0.0.0
gotchaModule only works in Node.js, not in the browser. No browser build available.
fix
Use an isomorphic library like `axios` or `fetch` for cross-platform support.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'q'
Missing peer dependency `q`. The package expects `q` to be installed separately.
fix
Run `npm install q` to install `q` as a dependency.
TypeError: request(...).then is not a function
Mixing CJS `require` with ES6 promise usage incorrectly, or not using the correct import.
fix
Ensure you import using ES6 `import` syntax or correctly convert the `q` promise to native.
ReferenceError: request is not defined
Trying to use `request` without importing it properly.
fix
Use `import http from 'promised-http'` and then call `http.request(options)`.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
qoptionalPeer dependency for promise implementation; the library uses `q` for deferred objects.
Agent activity
7 hits · last 30 days
node
6
Resources
promised-http — npm install promised-http · libregistry