simple-ingest

1.0.4 • Public • Published

Simpler version of Axios based on Fetch API

Installation

npm install simple-ingest

Usage

import SimpleIngest from 'simple-ingest';

const si = new SimpleIngest();

GET Request

si.get('https://api.example.com/data')
  .then(data => console.log(data))
  .catch(error => console.error(error));

POST Request

si.post('https://api.example.com/data', { key: 'value' })
  .then(data => console.log(data))
  .catch(error => console.error(error));

Retry Feature

si.get('https://api.example.com/data', { retries: 3, retryDelay: 2000 })
  .then(data => console.log(data))
  .catch(error => console.error(error));
  • retries: Number of retry attempts (default is 0).
  • retryDelay: Delay between retries in milliseconds (default is 1000).

Visit https://github.com/francislagasca/ingest

Readme

Keywords

none

Package Sidebar

Install

npm i simple-ingest

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

2.92 kB

Total Files

4

Last publish

Collaborators

  • francislagasca