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.
npm install requestifyVerified import paths — ran on the pinned version, not inferred.
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.
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.
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.
Replace calls to `requestify.redis()` with `requestify.cacheTransporter(requestify.coreCacheTransporters.redis(myRedisInstance));` for proper configuration and future compatibility.
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.
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.
Ensure `requestify` is listed in your `package.json` dependencies and installed via `npm install` or `yarn install`. Verify the `require('requestify')` statement is correct.Confirm `const requestify = require('requestify');` executed without error. Check for any naming conflicts in your scope that might be overwriting the `requestify` variable.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.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.