{"id":18752,"library":"restler","title":"restler","description":"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.","status":"maintenance","version":"3.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/danwrong/restler","tags":["javascript"],"install":[{"cmd":"npm install restler","lang":"bash","label":"npm"},{"cmd":"yarn add restler","lang":"bash","label":"yarn"},{"cmd":"pnpm add restler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Transparent charset handling","package":"iconv-lite","optional":true}],"imports":[{"note":"CJS require is the standard pattern for this package; there is no default ESM export.","wrong":"const restler = require('restler');","symbol":"restler","correct":"import restler from 'restler'"}],"quickstart":{"code":"const restler = require('restler');\n\nrestler.get('https://api.example.com/data', {\n  username: 'user',\n  password: process.env.PASS ?? ''\n}).on('complete', (data, response) => {\n  if (data instanceof Error) {\n    console.error('Error:', data.message);\n  } else {\n    console.log('Data:', data);\n  }\n});","lang":"javascript","description":"Demonstrates a basic GET request with authentication and handling the 'complete' event to check for errors."},"warnings":[{"fix":"Always attach 'error' or 'complete' listeners and handle errors properly.","message":"Events 'complete', 'success', 'fail' etc. are emitted on the request object; forgetting to attach listeners may cause unhandled events or memory leaks.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider migrating to axios, node-fetch, or got.","message":"The package is effectively deprecated; no updates since 2015 and not compatible with modern Node.js features.","severity":"deprecated","affected_versions":">=3.4.0"},{"fix":"Install xml2js, yaml, etc. if needed, or disable parsing.","message":"Automatic parsing of XML/YAML depends on optional dependencies that may not be installed.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install restler'.","cause":"Package not installed.","error":"Cannot find module 'restler'"},{"fix":"Use 'const restler = require('restler');' instead of import.","cause":"Incorrect import (ESM style used).","error":"TypeError: restler.get is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}