Registry / devops / fetch-plus-json

fetch-plus-json

JSON →
library3.10.4jsnpmunverified

Middleware for fetch-plus that adds automatic JSON parsing and request/response handling. Stable version 3.10.4, low release cadence (last update 2017). Integrates tightly with fetch-plus to simplify JSON API interactions. Key differentiator: minimal abstraction over the Fetch API while providing middleware chaining.

npm install fetch-plus-json
INSTALL
IMPORT
SIG · FETCH-PLUS-JSON
F
fetch-plus-json
devopsjavascriptv3.10.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jsonMiddleware
import { jsonMiddleware } from 'fetch-plus-json'
const json = require('fetch-plus-json')
ESM default export is an object; named export jsonMiddleware is recommended.
default export
import fetchPlusJson from 'fetch-plus-json'
const fetchPlusJson = require('fetch-plus-json').default
Default export is the middleware function, but named export is clearer.
json
import { json } from 'fetch-plus-json'
import json from 'fetch-plus-json'
json is a named export (middleware function), not default.

Create a fetch-plus client, apply jsonMiddleware, and make a GET request with automatic JSON parsing.

import fetchPlus from 'fetch-plus'; import { jsonMiddleware } from 'fetch-plus-json'; const client = fetchPlus.createClient(); client.use(jsonMiddleware); client.get('https://api.example.com/data') .then(response => console.log(response.data));
Debug
Known issues
gotchaRequires fetch-plus as peer dependency; will not fail install but throws at runtime if missing.
fix
Ensure fetch-plus is installed: npm install fetch-plus
affects: *
deprecatedPackage not updated since 2017; may have issues with modern Node.js and browser environments.
fix
Consider alternatives like ky or plain fetch with JSON handling.
affects: >=0.10.32
gotchajsonMiddleware must be added to client before making requests; otherwise JSON handling is skipped.
fix
Call client.use(jsonMiddleware) after creating the client.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'fetch-plus'
Missing peer dependency fetch-plus
fix
npm install fetch-plus
TypeError: client.use is not a function
Importing jsonMiddleware without creating a fetch-plus client
fix
Create client via fetch-plus.createClient() first.
ReferenceError: fetch is not defined
Using in Node.js without polyfill for fetch
fix
Install and import node-fetch: npm install node-fetch
Upgrade
Version history
3.10.4latest on npm
Audit
Dependencies
fetch-plusrequiredpeer dependency, provides the core fetch client
Agent activity
2 hits · last 30 days
node
2
Resources
fetch-plus-json — npm install fetch-plus-json · libregistry