Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@increments/request

Package Overview
Dependencies
Maintainers
7
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@increments/request

Minimalistic XHR wrapper

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created
Source

@increments/request

NPM version Build Status Maintainability Test Coverage Stable Release Size

Minimalistic XHR wrapper. Zero dependency.

Installation

If your project is using npm, you can install @increments/request package by npm command:

npm install --save @increments/request
# or
yarn add @increments/request

Distribution files

  • dist/index.js - The CommonJS version of this package. (default)
  • dist/index.es.js - The native modules version of this package.
  • dist/request.es5.js - ES5 / UMD version of this package. This version exports itself to window.Request.

Synopsis

import { request } from "@increments/request"

request("POST", "/api/endpoint", {
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json;charset=UTF-8"
  },
  data: requestPayload
}).then(response => {
  //
}).catch(error => {
  //
})

TypeScript

// Declare type of response.data
request<{ users: { name: string }[] }>("GET", "/users")
  .then(response => {
    console.log(response.data.users[0].name) // Show first user's name.
  })

FAQs

Package last updated on 22 Mar 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc