JSPM

@skivy71/http

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q9555F
  • License ISC

Http Module

Package Exports

  • @skivy71/http

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 (@skivy71/http) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Http module

Description

This module provides a simple wrapper around 'axios', so that you can try / catch and get a consistent e.data, regardless of failure

Usage

var skivy71 = {
    http: require('@skivy71/http')
}

// async
try {
    var { data } = skivy71.http.get(`https://www.google.com`)
    console.log(data) // some crap
} catch(e) {
    console.log(e) // new Error(...)
    console.log(e.message) // response.data?
    console.log(e.status) // response.status
    console.log(e.headers) // response.headers
}