{"id":49198,"library":"rest-pipeline-js","title":"rest-pipeline-js","description":"Pipeline orchestration utilities for building modular REST API clients in JavaScript/TypeScript. Current stable version is 1.3.14, with regular releases. Key differentiators include sequential and parallel stage execution, retry with exponential backoff and Retry-After support, response caching for GET requests, rate limiting, auth provider with automatic 401 refresh, stream stages (SSE/AsyncIterable), pause/resume/abort capabilities, pipeline metrics, a plugin system, persist adapter, and Vue/React integrations. It ships TypeScript types and has a single runtime dependency (axios). Peer dependencies for React/Vue integrations are separate entry points.","status":"active","version":"1.3.14","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","rest","api","client","pipeline","typescript"],"install":[{"cmd":"npm install rest-pipeline-js","lang":"bash","label":"npm"},{"cmd":"yarn add rest-pipeline-js","lang":"bash","label":"yarn"},{"cmd":"pnpm add rest-pipeline-js","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"HTTP client used by RestClient","package":"axios","optional":false},{"reason":"Peer dependency for React integration entry point","package":"react","optional":true},{"reason":"Peer dependency for React integration entry point","package":"react-dom","optional":true}],"imports":[{"note":"ESM-only; CommonJS require is not supported.","wrong":"const RestClient = require('rest-pipeline-js')","symbol":"RestClient","correct":"import { RestClient } from 'rest-pipeline-js'"},{"note":"Named export, not default.","wrong":"import createRestClient from 'rest-pipeline-js'","symbol":"createRestClient","correct":"import { createRestClient } from 'rest-pipeline-js'"},{"note":"React integration is in its own entry point to allow tree-shaking.","wrong":"import { usePipelineRunReact } from 'rest-pipeline-js'","symbol":"usePipelineRunReact","correct":"import { usePipelineRunReact } from 'rest-pipeline-js/react'"}],"quickstart":{"code":"import { createRestClient } from 'rest-pipeline-js';\nimport { usePipelineRunReact } from 'rest-pipeline-js/react';\n\nconst client = createRestClient({\n  baseURL: 'https://api.example.com',\n  retry: { maxRetries: 3, baseDelay: 1000 },\n  cache: { ttl: 60000 },\n  rateLimit: { maxConcurrent: 5, intervalMs: 1000, maxRequestsPerInterval: 10 },\n});\n\n// Example: sequential pipeline with two stages\nconst pipeline = client.createPipeline({\n  stages: [\n    {\n      name: 'fetchUser',\n      request: { url: '/user', method: 'GET' },\n    },\n    {\n      name: 'fetchPosts',\n      condition: (ctx) => ctx.stageResults?.fetchUser?.status === 200,\n      request: { url: '/posts', method: 'GET' },\n    },\n  ],\n});\n\npipeline.onPipelineEnd = (result) => console.log('Pipeline finished', result);\n\npipeline.execute().then(() => console.log('Done'));","lang":"typescript","description":"Shows how to create a rest client with retry, cache, and rate limiting, then define a two-stage pipeline with conditional execution."},"warnings":[{"fix":"Install react and react-dom if using React integrations: npm install react react-dom. For Vue integrations, ensure Vue 3 is available (peer dependency not formally declared).","message":"Vue and React integrations require peer dependencies (react, react-dom) to be installed separately. They are not included in the core package.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Change import RestClient from 'rest-pipeline-js' to import { RestClient } from 'rest-pipeline-js'.","message":"In version 1.0.0, the package switched from a default export to named exports. All users must update imports.","severity":"breaking","affected_versions":">=1.0.0 <1.1.0"},{"fix":"Update calls to createPipeline() to pass a config object: createPipeline({ stages: [] }).","message":"The old function createPipeline() without arguments is deprecated. Use createPipeline(config) with explicit config object.","severity":"deprecated","affected_versions":">=1.2.0"},{"fix":"Pass adapter in the initial config to RestClient constructor: new RestClient({ adapter: myAdapter }).","message":"The HTTP adapter option is only available when creating a new RestClient. It cannot be changed after client creation.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update custom persist adapters: save must accept (key, data) and return Promise<void>; load must accept (key) and return Promise<any>.","message":"In version 1.3.0, the persist adapter interface changed. Custom persist adapters must implement save/load methods with a specific signature.","severity":"breaking","affected_versions":">=1.3.0"}],"env_vars":null,"search_vec":"'1.3.14':20 '401':52 'adapt':65 'api':12,91 'auth':48 'automat':51 'axio':79 'backoff':35 'build':9 'cach':42 'capabl':58 'client':13,92 'current':16 'depend':78,81 'differenti':25 'entri':87 'execut':31 'exponenti':34 'get':44 'includ':26 'integr':68,84 'javascript':89 'javascript/typescript':15 'js':4 'key':24 'limit':47 'metric':60 'modular':10 'orchestr':6 'parallel':29 'pause/resume/abort':57 'peer':80 'persist':64 'pipelin':3,5,59,93 'plugin':62 'point':88 'provid':49 'rate':46 'react/vue':83 'refresh':53 'regular':22 'releas':23 'request':45 'respons':41 'rest':2,11,90 'rest-pipeline-j':1 'retri':32,38 'retry-aft':37 'runtim':77 'separ':86 'sequenti':27 'ship':70 'singl':76 'sse/asynciterable':56 'stabl':17 'stage':30,55 'stream':54 'support':40 'system':63 'type':72 'typescript':71,94 'util':7 'version':18 'vue/react':67","created_at":"2026-06-07T17:00:33.283128+00:00","updated_at":"2026-06-07T17:00:33.283128+00:00","problems":[{"fix":"Use import syntax: import { createRestClient } from 'rest-pipeline-js'; or use dynamic import: const { createRestClient } = await import('rest-pipeline-js');","cause":"Using CommonJS require() for this ESM-only package.","error":"ERR_REQUIRE_ESM: require() of ES Module not supported"},{"fix":"Create a client first: const client = createRestClient({...}); then call client.createPipeline({...}).","cause":"Importing createPipeline directly from package instead of using it on a client instance.","error":"TypeError: client.createPipeline is not a function"},{"fix":"Install react and react-dom (npm install react react-dom) and ensure you're importing from 'rest-pipeline-js/react' (not 'rest-pipeline-js').","cause":"Missing peer dependencies (react, react-dom) or incorrect import path.","error":"Module not found: Can't resolve 'rest-pipeline-js/react'"},{"fix":"Ensure you pass a valid adapter in the RestClient config: createRestClient({ adapter: myFetchAdapter }). The adapter must be compatible with the axios adapter interface.","cause":"Custom HTTP adapter not provided or configured incorrectly.","error":"Uncaught (in promise) Error: No adapter found for request"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://macrulez.ru/#/en","github":null,"docs":null,"changelog":null,"pypi":null,"npm":"rest-pipeline-js","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}