Registry / http-networking / httpplease

httpplease

JSON →
library0.16.4jsnpmunverified

httpplease is a lightweight (under 2KB gzipped) HTTP request library designed for "isomorphic" JavaScript applications, enabling the same codebase to run in both Node.js and browser environments. It maintains a browser-driven focus, explicitly supporting older environments like IE9 for cross-domain requests via plugins. The library features a simple, yet powerful, plugin system for extending its core functionality, such as adding Promise support or handling specific browser limitations. The current stable version is 0.16.4. The package appears to be unmaintained as there haven't been new releases in a considerable time, and its GitHub repository doesn't show recent activity, suggesting a stalled development lifecycle.

npm install httpplease
INSTALL
IMPORT
SIG · HTTPPLEASE
H
httpplease
http-networkingjavascriptv0.16.4
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.

httpplease
import httpplease from 'httpplease';
import { httpplease } from 'httpplease';
The library primarily exports a default function. While modern bundlers might handle named imports for CJS modules, a default import is the conventional approach for consuming its main export in ESM.
httpplease
const httpplease = require('httpplease');
This is the standard CommonJS import pattern, explicitly supported for bundlers like Browserify and Webpack mentioned in the README.
httpplease
httpplease.get('http://example.com', ...);
const { get } = require('httpplease'); get('http://example.com', ...);
The `get` method is a property of the main `httpplease` export, not a named export itself. Destructuring requires accessing the property after importing the main object.

Demonstrates a basic GET request using `httpplease.get` and shows how to create a custom instance with default options using `httpplease.defaults` for a more complex API interaction.

const httpplease = require('httpplease'); httpplease.get('http://example.com', function (err, res) { if (err) { console.error('Request failed:', err.message); return; } console.log('Request successful! Status:', res.status); console.log('Response body (truncated):', res.body ? res.body.substring(0, 100) + '...' : '[empty]'); // Example: Using the defaults method to create a specialized instance const secureHttp = httpplease.defaults({ url: 'https://api.example.com/v1', headers: {'X-Auth-Token': process.env.API_KEY ?? ''}, errorOn404: false }); secureHttp({ method: 'POST', body: JSON.stringify({ data: 'hello' }) }, function(err, res) { if (err) { console.error('Secure API request failed:', err.message); return; } console.log('Secure API response status:', res.status); }); });
Debug
Known issues
gotchaThe library appears to be unmaintained and has not seen updates for a considerable period. This means it may not address modern web standards, security vulnerabilities, or common performance optimizations found in actively developed HTTP clients.
fix
Consider migrating to a modern, actively maintained HTTP client library that provides better security, performance, and feature support for contemporary JavaScript environments.
affects: <=0.16.4
gotchahttpplease is primarily designed with CommonJS (CJS) module semantics, as indicated by its `require()` examples. While bundlers can often bridge CJS into ESM environments, direct usage in pure ESM Node.js projects might require specific configuration or the use of dynamic `import()`.
fix
For ESM projects, use `import httpplease from 'httpplease';` and ensure your build tools (e.g., Webpack, Rollup) are configured to handle CJS interoperability. In Node.js, if in an ESM context, consider `const httpplease = await import('httpplease');` or ensure your project's `package.json` `type` field is not set to `module` unless you explicitly configure CJS loading.
affects: <=0.16.4
gotchaThe library defaults `errorOn404` to `true`, meaning HTTP 404 (Not Found) responses will trigger the error callback/promise rejection by default. This might not be desired for all applications where 404s are expected control flow rather than errors.
fix
To treat 404 responses as successful non-error outcomes, set `errorOn404: false` in your request options: `httpplease.get({url: 'http://example.com/missing', errorOn404: false}, (err, res) => { /* handle 404 in res */ });`
affects: >=0.1.0
gotchaThe README mentions supporting 'old IE' (IE9) and implicitly, older browser capabilities. This focus might mean modern browser features (e.g., `fetch` API alternatives, advanced CORS headers, service worker integration) are not natively supported or optimized without additional plugins or manual intervention.
fix
For modern browser development, ensure you understand its underlying implementation (likely `XMLHttpRequest`) and any limitations this might impose compared to `fetch` or other contemporary solutions. Consider polyfills or other libraries for newer features.
affects: <=0.16.4
Errors
Common errors & fixes
Timeout
The HTTP request took longer than the configured `timeout` value.
fix
Increase the `timeout` option in your request configuration or optimize the server response time. Example: `httpplease.get({url: 'http://example.com', timeout: 5000}, (err, res) => { if (err && err.name === 'Timeout') { console.error('Request timed out'); } });`
TypeError: httpplease is not a function
Attempting to call `httpplease()` directly when it was imported as a named export or when a bundler's CJS-ESM interop created an object.
fix
Ensure you are importing `httpplease` as a default export or requiring it as the main module. If using a `<script>` tag, ensure the global `httpplease` object is correctly loaded. Example: `import httpplease from 'httpplease'; httpplease({method: 'GET', url: '...'});` or `const httpplease = require('httpplease'); httpplease({method: 'GET', url: '...'});`
ReferenceError: httpplease is not defined
The `httpplease` variable is not accessible in the current scope, often when using a standalone build via a `<script>` tag and the script hasn't loaded or the variable name is incorrect.
fix
Verify that the `httpplease` standalone build script is correctly included in your HTML before your application code, and that no other script is overwriting the global `httpplease` variable.
HTTP 404 Not Found (error callback invoked)
The requested resource was not found on the server, and `errorOn404` is set to `true` (which is the default behavior).
fix
If 404s are expected and should not be treated as errors, set `errorOn404: false` in your request options. This will make the 404 response appear in the success callback (`res`) instead of the error callback (`err`).
Upgrade
Version history
0.16.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
httpplease — npm install httpplease · libregistry