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

shred

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shred - npm Package Compare versions

Comparing version 1.1.0-alpha-01 to 1.1.0-alpha-02

2

package.json
{
"name": "shred",
"version": "1.1.0-alpha-01",
"version": "1.1.0-alpha-02",
"description": "A resource-oriented JavaScript HTTP client.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -121,1 +121,25 @@ # Overview

Subresources defined using URL templates will be functions, allowing you to pass in an object whose key-value pairs will instantiate the template.
### Shred Responses
When you invoke a Shred request functions, you get back a response context. This contains both the HTTP response object and a data object. The data object is a promise that resolves when the response body is finished streaming. If the `content-type` appears to be JSON-based, Shred will parse the response body as JSON and return an object, otherwise, it will return a string.
### Explicit Invocation
You can explicit invoke Shred request functions using the `invoke` command. This is particularly useful when using helper functions defined on the request function, such as `authorize`.
### Authorization With Shred
You can use the `authorization` method defined on request functions to pass authorization information into the request. The `authorization` function takes a object describing the authorization scheme. Currently, `basic` and `bearer` are supported.
#### Example
```coffeescript
try
yield github
.repo {owner, repo}
.issues
.create
.authorize basic: {username: token, password: ""}
.invoke {title, body}
```

Sorry, the diff of this file is not supported yet

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