{"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.","language":"javascript","status":"abandoned","last_verified":"Wed Apr 22","install":{"commands":["npm install requestify"],"cli":null},"imports":["const requestify = require('requestify');","requestify.get('http://example.com').then(...);","const coreCacheTransporters = requestify.coreCacheTransporters;"],"auth":{"required":false,"env_vars":[]},"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}