Socket
Socket
Sign inDemoInstall

@increments/request

Package Overview
Dependencies
0
Maintainers
7
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @increments/request

Minimalistic XHR wrapper


Version published
Weekly downloads
0
decreased by-100%
Maintainers
7
Install size
183 kB
Created
Weekly downloads
 

Changelog

Source

[0.1.0] - 2018-03-22

Added

  • Initial release

Readme

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

Last updated on 22 Mar 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc