A minimal HTTP client library for Node.js with a focus on simplicity and ease of use. Version 1.2.0 is the current stable release. The package provides basic HTTP request functionality with automatic JSON parsing, support for custom headers, and stream handling. It differentiates itself by requiring no external dependencies and offering a straightforward API for common use cases, though it lacks advanced features like interceptors or cancellation found in larger libraries. Released on an ad-hoc cadence with no recent updates.
npm install smart-httpVerified import paths — ran on the pinned version, not inferred.
Shows a basic GET request with async/await, environment variable for auth, and error handling.
Declare module augmentation or use @types/smart-http if available.
Pass a signal option from AbortController.timeout() to enable cancellation.
Switch to promise-based API for new code.
Check response.ok and then JSON.parse(response.data) for non-2xx responses.
Use 'form-data' package and pipe it to a request.
Use import http from 'smart-http' instead of const http = require('smart-http').Convert the importing module to ESM (use 'import' statements) or use dynamic import().
Declare a module augmentation for 'smart-http' or cast response as any.
No dependency data recorded yet.