{"id":17349,"library":"requestify","title":"Requestify - Node HTTP Client with Caching","description":"Requestify is an HTTP client for Node.js, designed to simplify making HTTP requests and provide built-in caching capabilities. It utilizes the Q promise library for asynchronous operations, returning promises for all network calls. As of its last major release, version 0.2.5 (published in 2016), it supports in-memory, Redis, and MongoDB caching via pluggable transporters. The package was primarily built for Node.js environments around `~0.10.x`, making it incompatible with modern Node.js runtimes. Its key differentiators at the time were its promise-based API (using Q) and an extensible caching mechanism. The project appears to be abandoned, with no significant updates or maintenance for nearly a decade.","status":"abandoned","version":"0.2.5","language":"javascript","source_language":"en","source_url":"https://github.com/ranm8/requestify","tags":["javascript"],"install":[{"cmd":"npm install requestify","lang":"bash","label":"npm"},{"cmd":"yarn add requestify","lang":"bash","label":"yarn"},{"cmd":"pnpm add requestify","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core promise library used for all asynchronous operations.","package":"q","optional":false},{"reason":"Required if using the Redis cache transporter for persistent caching.","package":"redis","optional":true},{"reason":"Required if using the MongoDB cache transporter for persistent caching.","package":"mongoose","optional":true}],"imports":[{"note":"Requestify is a CommonJS module and must be imported using `require()`. ESM imports will not work.","wrong":"import requestify from 'requestify';","symbol":"requestify","correct":"const requestify = require('requestify');"},{"note":"HTTP methods are directly available on the default exported `requestify` object.","wrong":"requestify().get('http://example.com');","symbol":"requestify.get","correct":"requestify.get('http://example.com').then(...);"},{"note":"Nested properties like `coreCacheTransporters` are accessed via the main `requestify` object, not through named ESM imports.","wrong":"import { coreCacheTransporters } from 'requestify';","symbol":"requestify.coreCacheTransporters","correct":"const coreCacheTransporters = requestify.coreCacheTransporters;"}],"quickstart":{"code":"const requestify = require('requestify');\n\nasync function performRequests() {\n  // Set a custom encoding (optional, utf8 is default)\n  requestify.setEncoding('utf8');\n\n  // Example GET request\n  console.log('Performing GET request...');\n  try {\n    const getResponse = await requestify.get('https://httpbin.org/get').then(function(response) {\n      return response.getBody(); // Q-promise .then()\n    });\n    console.log('GET Response Body:', getResponse);\n  } catch (error) {\n    console.error('GET Error:', error.message || error.code || error);\n  }\n\n  // Example POST request with JSON body\n  console.log('\\nPerforming POST request...');\n  try {\n    const postResponse = await requestify.post('https://httpbin.org/post', {\n      hello: 'world',\n      timestamp: new Date().toISOString()\n    }).then(function(response) {\n      return response.getBody(); // Q-promise .then()\n    });\n    console.log('POST Response Body:', postResponse);\n  } catch (error) {\n    console.error('POST Error:', error.message || error.code || error);\n  }\n\n  // Example GET request with caching enabled (requires cache transporter setup)\n  console.log('\\nPerforming cached GET request...');\n  // Using the default in-memory cache transporter\n  const coreCacheTransporters = requestify.coreCacheTransporters;\n  requestify.cacheTransporter(coreCacheTransporters.inMemory());\n  try {\n    const cachedGetResponse = await requestify.get('https://httpbin.org/delay/1', { \n      cache: { cache: true, expires: 5000 } // Cache for 5 seconds\n    }).then(function(response) {\n      return response.getBody();\n    });\n    console.log('Cached GET Response Body (first call):', cachedGetResponse);\n\n    // Immediately fetch again, should be from cache if within 5 seconds\n    const cachedGetResponse2 = await requestify.get('https://httpbin.org/delay/1', { \n      cache: { cache: true, expires: 5000 } \n    }).then(function(response) {\n      return response.getBody();\n    });\n    console.log('Cached GET Response Body (second call, should be fast):', cachedGetResponse2);\n  } catch (error) {\n    console.error('Cached GET Error:', error.message || error.code || error);\n  }\n}\n\nperformRequests();","lang":"javascript","description":"This quickstart demonstrates basic GET and POST requests, shows how to set encoding, and illustrates the use of Requestify's built-in caching mechanism with the default in-memory transporter. It highlights the promise-based nature of the API using the `then` method."},"warnings":[{"fix":"This package is not recommended for new projects. Consider modern alternatives like `axios`, `node-fetch`, or `undici`. For existing projects, consider a shim or a rewrite, as upgrading Node.js is critical for security and performance.","message":"Requestify requires Node.js version ~0.10.x. It is largely incompatible with modern Node.js versions (v12+). Running it on newer Node.js runtimes will likely result in unexpected behavior or errors due to API changes and removed core modules.","severity":"breaking","affected_versions":">=0.2.5"},{"fix":"Be mindful of Q's API for promises, including `.then(onFulfilled, onRejected)` and `.fail(onRejected)` for error handling. Avoid mixing with native Promises unless using `Q.fcall(asyncFn)` to wrap native async functions.","message":"Requestify uses the 'Q' promise library for asynchronous operations, not native ES6 Promises. Developers expecting native Promise behavior (e.g., `catch()` instead of `fail()`, `finally()`) or interoperability might encounter issues.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Replace calls to `requestify.redis()` with `requestify.cacheTransporter(requestify.coreCacheTransporters.redis(myRedisInstance));` for proper configuration and future compatibility.","message":"The `requestify.redis(redisInstance)` method is deprecated. Users should instead configure the Redis cache transporter directly via `requestify.cacheTransporter(requestify.coreCacheTransporters.redis(myRedisInstance));`.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Do not use Requestify for new projects. For existing projects, migration to a maintained HTTP client is strongly advised to avoid security vulnerabilities and ensure compatibility with modern infrastructure.","message":"The Requestify project appears to be abandoned. Its last publish date was 9 years ago (2016), and it targets a very old Node.js engine (~0.10.x). This means it receives no security updates, bug fixes, or new features.","severity":"gotcha","affected_versions":">=0.2.5"},{"fix":"Consider using a modern HTTP client designed for TypeScript and contemporary JavaScript, which provides type definitions and supports modern language features out-of-the-box.","message":"Requestify lacks native TypeScript support and modern JavaScript features (e.g., `async/await` syntax, `fetch` API alternatives). This can lead to less ergonomic code and challenges in TypeScript-first projects.","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Ensure `requestify` is listed in your `package.json` dependencies and installed via `npm install` or `yarn install`. Verify the `require('requestify')` statement is correct.","cause":"The package `requestify` is not installed or the `require()` path is incorrect.","error":"Error: Cannot find module 'requestify'"},{"fix":"Confirm `const requestify = require('requestify');` executed without error. Check for any naming conflicts in your scope that might be overwriting the `requestify` variable.","cause":"The `requestify` module was not successfully loaded or the object is not the expected Requestify instance. This can happen with incorrect `require()` usage or if a different module is aliased as `requestify`.","error":"TypeError: requestify.get is not a function"},{"fix":"Always reject promises with `new Error('message')` instead of plain strings or objects. Ensure all promises have a `.fail()` or `.then(null, onRejected)` handler to catch rejections. Upgrade Node.js if possible, as this warning might be indicative of other compatibility issues.","cause":"This warning, often seen in older Node.js versions or with specific promise libraries like Q, indicates that a promise rejected with a value that is not an `Error` object, or that a promise rejection was not caught.","error":"UnhandledPromiseRejectionWarning: DeprecationWarning: A promise was rejected with a non-error: [object Object]"},{"fix":"While `requestify` uses `Q` promises (which does not depend on native `Promise`), attempting to use native `Promise` methods without a polyfill in old Node.js (~0.10.x) would cause this. Ensure you are exclusively using `Q`'s promise API or explicitly polyfill `Promise` if mixing.","cause":"This error occurs in very old Node.js environments where native ES6 `Promise` is not globally available, or if transpilation targets an environment without `Promise`.","error":"ReferenceError: Promise is not defined"}],"ecosystem":"npm","meta_description":null}