{"library":"sl-request","title":"sl-request: Simplified HTTP Client (Fork of Deprecated 'request')","description":"sl-request is a Node.js HTTP client, version 1.0.8, explicitly stated as a fork of the widely used but now deprecated `request` library, primarily for internal use by sealights.io. This package attempts to provide a simplified API for making HTTP calls, supporting HTTPS, automatic redirects, streaming, and various request body types (forms, multipart). However, inheriting its core from the original `request` library, it carries the same limitations and risks, including a callback-centric API, known security vulnerabilities, and a lack of modern maintenance. The original `request` library was officially deprecated in February 2020 due to its unmaintained status, security risks, and outdated architectural patterns that do not align with modern JavaScript and Node.js paradigms. Users should be aware that `sl-request` likely shares these fundamental issues and does not offer a current, actively maintained solution for HTTP requests. Release cadence is infrequent, reflecting its internal-use nature and the deprecated status of its upstream.","language":"javascript","status":"deprecated","last_verified":"Wed Apr 22","install":{"commands":["npm install sl-request"],"cli":null},"imports":["import request from 'sl-request';","const request = require('sl-request');","import request from 'sl-request';\nrequest.get('...');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import request from 'sl-request';\nimport fs from 'fs';\n\n// Basic GET request\nrequest('http://www.google.com', function (error, response, body) {\n  if (error) {\n    console.error('Error:', error);\n    return;\n  }\n  console.log('statusCode:', response && response.statusCode);\n  console.log('Body snippet:', body.substring(0, 100) + '...');\n});\n\n// Stream a file to a PUT request\n// For demonstration, create a dummy file first\nfs.writeFileSync('temp_upload.json', JSON.stringify({ message: 'Hello from sl-request' }));\n\nfs.createReadStream('temp_upload.json')\n  .pipe(request.put('http://httpbin.org/put', function (error, response, body) {\n    if (error) {\n      console.error('PUT Error:', error);\n      return;\n    }\n    console.log('PUT statusCode:', response && response.statusCode);\n    console.log('PUT Response:', body);\n    fs.unlinkSync('temp_upload.json'); // Clean up dummy file\n  }));\n\n// Example of error handling for streaming\nrequest.get('http://nonexistent-domain.invalid/image.png')\n  .on('error', function(err) {\n    console.error('Streaming error caught:', err.message);\n  })\n  .pipe(fs.createWriteStream('downloaded_image.png'));","lang":"typescript","description":"Demonstrates basic GET request, streaming a file via PUT, and error handling for stream-based operations, using `sl-request`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}