0.0.5 • Published 5 years ago

@joe-sh/pnpm-api-adapters v0.0.5

Weekly downloads
-
License
-
Repository
-
Last release
5 years ago

Example API Adapters Package

This package provides sample api adapters for the JSONPlaceholder website that work with two different http libraries: axios and node-fetch.

Installation

pnpm i @joe-sh/pnpm-api-adapters

axios Usage

When using the axios adapters, you must also install axios.

pnpm i axios
const adapter = require('@joe-sh/pnpm-api-adapters/main.axios.js');
adapter('todos/1').then((resp) => console.log(resp));

node-fetch Usage

When using the node-fetch adapters, you must also install node-fetch.

pnpm i node-fetch
const adapter = require('@joe-sh/pnpm-api-adapters/main.fetch.js');
adapter('todos/1').then((resp) => console.log(resp));