arxios

Observable based HTTP client on top of axios for browser and node.js

Usage no npm install needed!

<script type="module">
  import arxios from 'https://cdn.skypack.dev/arxios';
</script>

README

A[rx]ios

Build Status Coverage Status

NPM

Observable based HTTP client on top of axios for browser and node.js

Installing

  • npm install arxios rxjs

Using

Can be created as an axios instance and used with same syntax and options, only returns Observables instead of Promises.

const arxios = new Arxios({
  baseURL: 'test.com',
  withCredentials: false,
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  });

arxios.get('users', { params: { show_disabled: 'true' } }).subscribe((user) => {
  [...]
});

Also the internal axios instance is available.

const arxios = new Arxios();
arxios.axiosInstance.interceptors.request.use([...])

TypeScript

Arxios is coded entirely in TypeScript.

Building/Testing

  • npm install
  • npm run build
  • npm run lint
  • npm run test or npm run test:watch