A lightweight REST client that works in both browser and Node.js environments, with CRUD methods, promise support, caching, and a middleware system for request/response transformation. Version 1.1.3 is the latest stable release, with low maintenance cadence. Differentiators include isomorphic design (client/server), URL-based response caching, and built-in middlewares for JSON handling and HTTP method workaround for browsers. Supports GET, POST, PUT, DELETE and arbitrary HTTP methods via .request().
npm install rest-jsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a REST client instance, issue a GET request, and handle the response using both callback and promise patterns.
Ensure middleware function has exactly the number of parameters expected: 2 for request filter, 3 for request+response, 4 for error filter.
Use .remove() instead of .del() as it's more descriptive.
Set cacheLifetime: 0 to disable caching, or adjust the lifetime as needed.
Use default import: import rest from 'rest-js' or const rest = require('rest-js').Create an instance first: const api = rest(baseUrl); api.read(path);
Ensure you have created an instance: const api = rest(baseUrl); api.use(middleware);
Run 'npm install rest-js' and use 'const rest = require("rest-js")'.No dependency data recorded yet.