JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3541
  • Score
    100M100P100Q123627F
  • License MIT

Slim progress bar (NProgress) for Web applications that use Axios library for HTTP requests.

Package Exports

  • axios-progress-bar

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (axios-progress-bar) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Axios Progress Bar

This module provides a simple usage of a progress bar for the HTTP requests made by Web applications that use the library axios. It's high inspired in the module angular-loading-bar and uses the fantastic nprogress module for display the loading bar in the Browser.

Attention: This module is not bound to any framework. You can use it in any Web application that uses axios.

Demo

demo

Installation

It's available through the NPM package:

npm install --save axios
npm install --save axios-progress-bar

Or via CDN:

<script src="https://cdn.rawgit.com/rikmms/progress-bar-4-axios/master/dist/index.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

Usage

Simple as invoke (only one time) the function: loadProgressBar(config), where the config argument is the configuration object for the nprogress and is not required. Its properties can be seen here.

An example in ES6 using the new import statement

import axios from 'axios'
import { loadProgressBar } from 'axios-progress-bar'

loadProgressBar()
....

An example using plain HTML and Javascript in the Browser

<!DOCTYPE html>
<html lang="en">
  <head>
    ...
  </head>
  <body>
    ...
  </body>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  <script src="https://cdn.rawgit.com/rikmms/progress-bar-4-axios/master/dist/index.js"></script>
  
  <script type="text/javascript">
    loadProgressBar()
    ...
  </script>
  
</html>

Bugs/Requests

Write them in the repository issues.