New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@launchpadlab/lp-requests

Package Overview
Dependencies
Maintainers
4
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@launchpadlab/lp-requests

Request helpers

latest
Source
npmnpm
Version
4.3.0
Version published
Weekly downloads
230
27.07%
Maintainers
4
Weekly downloads
 
Created
Source

NPM version

lp-requests

Promise-based helpers for making HTTP requests.

import { api, configureApi } from '@launchpadlab/lp-requests'

// Make a request
api
  .get('/user', { query: { id: 1 } })
  .then((response) => {
    // handle success
  })
  .catch((error) => {
    // handle error
  })

// Configure defaults
const externalApi = configureApi({
  root: 'https://my-external-api/',
  mode: 'cors',
})

externalApi.get('/user', { query: { id: 1 } })
// -> makes a request to https://my-external-api/user?id=1

A full list of available request options may be found in the documentation.

Relation to axios

lp-requests serves the exact same function as axios- that is, it provides a thin wrapper around the Fetch API. Once axios has become appropriately stable, it may be used as a replacement for lp-requests.

Documentation

Documentation and usage info can be found in docs.md.

Migration Guides

  • v4.0.0

Contribution

This package follows the Opex NPM package guidelines. Please refer to the linked document for information on contributing, testing and versioning.

FAQs

Package last updated on 07 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts