{"id":18692,"library":"promised-http","title":"promised-http","description":"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.","status":"deprecated","version":"0.0.2","language":"javascript","source_language":"en","source_url":"git://github.com/Gozala/promised-http","tags":["javascript","promise","q","http"],"install":[{"cmd":"npm install promised-http","lang":"bash","label":"npm"},{"cmd":"yarn add promised-http","lang":"bash","label":"yarn"},{"cmd":"pnpm add promised-http","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for promise implementation; the library uses `q` for deferred objects.","package":"q","optional":true}],"imports":[{"note":"The library exports a single `request` function. CommonJS require works if the package is consumed as CJS, but ESM is preferred for modern projects.","wrong":"const request = require('promised-http').request;","symbol":"request","correct":"import { request } from 'promised-http';"},{"note":"The default import gives access to the `request` function directly. Using `http.request()` is also valid.","wrong":"const http = require('promised-http');","symbol":"default import","correct":"import http from 'promised-http';"},{"note":"The library does not export a `get` function; it only exports `request`. This is a common mistake.","wrong":"const get = require('promised-http').get;","symbol":"get","correct":"import { get } from 'promised-http';"}],"quickstart":{"code":"import http from 'promised-http';\n\nconst options = {\n  host: 'api.example.com',\n  path: '/data',\n  method: 'GET'\n};\n\nhttp.request(options)\n  .then(response => {\n    console.log('Status:', response.statusCode);\n    return response.body;\n  })\n  .then(body => console.log('Body:', body))\n  .catch(err => console.error('Error:', err));","lang":"javascript","description":"Demonstrates basic GET request using the promise-based `request` function from promised-http. Note: The library is outdated and not recommended for production."},"warnings":[{"fix":"Replace with a maintained HTTP client library.","message":"Package is unmaintained since 2011. Use modern alternatives like `axios`, `node-fetch`, or `got`.","severity":"deprecated","affected_versions":"0.0.2"},{"fix":"Convert `q` promises to native Promises using `Q()` or upgrade to a library with native promises.","message":"Uses `q` promises, not ES6 Promises. Will not work with native `async/await` without conversion.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use the `http.request` options object; do not pass a URL string.","message":"The `request` function expects options in Node.js `http.request` format (e.g., `host`, `port`, `path`). Not compatible with URL strings.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use Node's `https` module or a modern library that handles both HTTP and HTTPS.","message":"No built-in support for HTTPS. Requires separate handling or using Node's https module directly.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use an isomorphic library like `axios` or `fetch` for cross-platform support.","message":"Module only works in Node.js, not in the browser. No browser build available.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install q` to install `q` as a dependency.","cause":"Missing peer dependency `q`. The package expects `q` to be installed separately.","error":"Error: Cannot find module 'q'"},{"fix":"Ensure you import using ES6 `import` syntax or correctly convert the `q` promise to native.","cause":"Mixing CJS `require` with ES6 promise usage incorrectly, or not using the correct import.","error":"TypeError: request(...).then is not a function"},{"fix":"Use `import http from 'promised-http'` and then call `http.request(options)`.","cause":"Trying to use `request` without importing it properly.","error":"ReferenceError: request is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}