Registry / http-networking / sl-request

sl-request

JSON →
library1.0.8jsnpmunverified

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.

npm install sl-request
INSTALL
IMPORT
SIG · SL-REQUEST
S
sl-request
http-networkingjavascriptv1.0.8
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

request
import request from 'sl-request';
const request = require('request');
While `request` was the original package name, this fork is named `sl-request`. This is the primary ESM import pattern. CommonJS `require` is also supported.
request (CommonJS)
const request = require('sl-request');
import request from 'sl-request';
This is the CommonJS import pattern, as shown in the package's README, adjusted for the `sl-request` package name. The underlying `request` library was primarily CJS-focused.
request.get, request.post
import request from 'sl-request'; request.get('...');
import { get } from 'sl-request';
The `request` library (and thus this fork) exports a main function, with convenience methods like `get` and `post` attached as properties to that function, not as named exports directly from the module.

Demonstrates basic GET request, streaming a file via PUT, and error handling for stream-based operations, using `sl-request`.

import request from 'sl-request'; import fs from 'fs'; // Basic GET request request('http://www.google.com', function (error, response, body) { if (error) { console.error('Error:', error); return; } console.log('statusCode:', response && response.statusCode); console.log('Body snippet:', body.substring(0, 100) + '...'); }); // Stream a file to a PUT request // For demonstration, create a dummy file first fs.writeFileSync('temp_upload.json', JSON.stringify({ message: 'Hello from sl-request' })); fs.createReadStream('temp_upload.json') .pipe(request.put('http://httpbin.org/put', function (error, response, body) { if (error) { console.error('PUT Error:', error); return; } console.log('PUT statusCode:', response && response.statusCode); console.log('PUT Response:', body); fs.unlinkSync('temp_upload.json'); // Clean up dummy file })); // Example of error handling for streaming request.get('http://nonexistent-domain.invalid/image.png') .on('error', function(err) { console.error('Streaming error caught:', err.message); }) .pipe(fs.createWriteStream('downloaded_image.png'));
Debug
Known issues
breakingThe `sl-request` package is a direct fork of the original `request` library, which has been officially deprecated since February 2020 and is no longer maintained. This means `sl-request` inherently carries all the maintenance, security, and architectural issues of the unmaintained `request` library.
fix
Migrate to a modern, actively maintained HTTP client like `axios`, `node-fetch`, or `got`. Review your project's dependency tree for `request` or its forks and plan for replacement.
affects: >=1.0.0
breakingDue to its unmaintained nature, `sl-request` (and `request`) is susceptible to unpatched security vulnerabilities. Continuing to use it can expose your application to critical security risks, including supply chain attacks, data breaches, or denial-of-service vulnerabilities.
fix
Immediately replace `sl-request` with a secure, well-maintained HTTP client. Regularly audit your dependencies using `npm audit` and keep them updated.
affects: >=1.0.0
gotchaThe API is primarily callback-based, which can lead to 'callback hell' in complex asynchronous flows. While some promise-based wrappers existed for the original `request`, `sl-request` does not natively provide modern `async/await` support without manual promisification.
fix
If migrating is not immediately possible, use `util.promisify` from Node.js's built-in `util` module to wrap callback-style functions, or consider a dedicated promise-wrapper library if available for this fork. The better long-term solution is migration.
affects: >=1.0.0
gotchaThe original `request` library (and thus its forks) was known for potential memory leaks and performance inefficiencies, especially with high concurrency or large data streams, due to its older codebase and lack of modern optimizations.
fix
Monitor memory usage and performance closely in production. The most effective fix is to migrate to a modern HTTP client designed with better performance and memory management.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'request'
Attempting to `require('request')` or `import 'request'` instead of `sl-request` when the package installed is `sl-request`.
fix
Ensure you are importing the correct package name: `const request = require('sl-request');` or `import request from 'sl-request';`.
DeprecationWarning: request has been deprecated, see https://github.com/request/request/issues/3142
This warning directly indicates that the underlying `request` library, which `sl-request` is forked from, is deprecated. This warning will appear even for `sl-request` installations due to its origin.
fix
Acknowledge that `sl-request` inherits the deprecation status of its upstream. While the warning is expected, the recommended fix is to migrate to a modern, actively maintained HTTP client.
TypeError: request is not a function
This usually happens when `request` is imported incorrectly, such as `import { request } from 'sl-request';` instead of a default import, or if the `require` statement doesn't correctly assign the function.
fix
Use the correct import pattern: for ESM `import request from 'sl-request';` or for CJS `const request = require('sl-request');`. The main export is a callable function, not an object with named properties that need destructuring.
Upgrade
Version history
1.0.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
sl-request — npm install sl-request · libregistry