Registry / http-networking / restler

restler

JSON →
library0.7.1jsnpmunverified

An HTTP client library for Node.js (v3.4.0) that simplifies making HTTP requests with automatic serialization of POST data, query strings, and deserialization of XML, JSON, and YAML responses. It handles redirects, multipart file uploads, SSL, basic auth, content-encoding (gzip, deflate), and charset via iconv-lite. Compared to modern alternatives like axios or node-fetch, restler is older, less actively maintained, and uses an event-based API that can lead to memory leaks if not managed properly. It supports Node >= 0.10.x, with limited maintenance; version 3.4.0 is the latest, with no major updates since 2015.

npm install restler
INSTALL
IMPORT
SIG · RESTLER
R
restler
http-networkingjavascriptv0.7.1
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.

restler
import restler from 'restler'
const restler = require('restler');
CJS require is the standard pattern for this package; there is no default ESM export.

Demonstrates a basic GET request with authentication and handling the 'complete' event to check for errors.

const restler = require('restler'); restler.get('https://api.example.com/data', { username: 'user', password: process.env.PASS ?? '' }).on('complete', (data, response) => { if (data instanceof Error) { console.error('Error:', data.message); } else { console.log('Data:', data); } });
Debug
Known issues
gotchaEvents 'complete', 'success', 'fail' etc. are emitted on the request object; forgetting to attach listeners may cause unhandled events or memory leaks.
fix
Always attach 'error' or 'complete' listeners and handle errors properly.
affects: all
deprecatedThe package is effectively deprecated; no updates since 2015 and not compatible with modern Node.js features.
fix
Consider migrating to axios, node-fetch, or got.
affects: >=3.4.0
gotchaAutomatic parsing of XML/YAML depends on optional dependencies that may not be installed.
fix
Install xml2js, yaml, etc. if needed, or disable parsing.
affects: all
Errors
Common errors & fixes
Cannot find module 'restler'
Package not installed.
fix
Run 'npm install restler'.
TypeError: restler.get is not a function
Incorrect import (ESM style used).
fix
Use 'const restler = require('restler');' instead of import.
Upgrade
Version history
0.7.1latest on npm
Audit
Dependencies
iconv-liteoptionalTransparent charset handling
Agent activity
12 hits · last 30 days
node
12
Resources