A lightweight HTTP client built on the Fetch API with whatwg-fetch polyfill. It simplifies defining RESTful endpoints with support for path parameters, file uploads, custom headers (JSON, Form URL-encoded), request queuing, mock data, response parsing, parameter validation, and global error events. Version 0.2.16. Low release cadence. Ships TypeScript types. Differentiators: integrated mocking, useQueue option for sequential requests, and built-in content type constants. Suitable for React and Node environments.
npm install fetch-service-parserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows defining two endpoints using parseRequest, configuring method and headers with CONTENT_TYPES, then calling List with query params.
Use: import { services } from 'fetch-service-parser'; const { parseRequest } = services;Ensure the export is used as a function call (List(params)) not as JSX element.
To completely ignore errors, do not attach an 'error' listener, or filter errors inside the listener.
Set debug: true in the configuration or pass it in parseRequest options.
Use: import { services } from 'fetch-service-parser';Install and import whatwg-fetch before using fetch-service-parser: import 'whatwg-fetch'; or add polyfill to entry point.
Add debug: true to the parseRequest configuration: parseRequest({ url: '...', mock: {...}, debug: true })Import CONTENT_TYPES correctly: import { CONTENT_TYPES } from 'fetch-service-parser'; and use like CONTENT_TYPES.FORM_URL