New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@idagio/shortwreck

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@idagio/shortwreck

A nice short wrapper for Wreck

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

@idagio/shortwreck

A nice short wrapper for Wreck.

Usage

const ShortWreck = require('@idagio/shortwreck');

const ApiClient = ShortWreck({
  json: true
});

ApiClient.request("GET", "https://httpbin.org/get", (err, res, payload) => {
  if (err) {
    console.log(err);
    return;
  }

  console.log(res);
  console.log(payload);
});

API

new ShortWreck(options)

Takes the exact same options as wreck's defaults(options).

ShortWreck.prototype.request(method, uri /*, [options], callback */)

  • method - A string specifying the HTTP request method, defaulting to 'GET'.
  • uri - The URI of the requested resource.
  • options - Optional config object containing settings for both request and read operations. This will override the options initially passed to new ShortWreck(options).
  • callback - The callback function using the signature function (err, response, payload) where:
    • err - Any error that may have occurred during handling of the request.
    • response - The HTTP Incoming Message object, which is also a readable stream.
    • payload - The payload in the form of a Buffer or (optionally) parsed JavaScript object (JSON).

Returns an instance of the node.js ClientRequest object.

Keywords

FAQs

Package last updated on 01 Mar 2016

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