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

@zambezi/address

Package Overview
Dependencies
Maintainers
5
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zambezi/address - npm Package Compare versions

Comparing version 3.0.5 to 3.1.0

25

lib/address.js

@@ -113,2 +113,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

, into
, timeout = 30
, dispatcher = dispatch.apply(null, codes.range().concat(['err', 'done']))

@@ -125,2 +126,3 @@

body = r.body || body
timeout = r.timeout || timeout
}

@@ -275,2 +277,8 @@

api.timeout = function(v) {
if(!arguments.length) return timeout
timeout = v
return api
}
return rebind(api, dispatcher, 'on')

@@ -288,2 +296,3 @@

, origin: origin
, timeout: timeout
}

@@ -1214,9 +1223,15 @@

requestTimeout : function(req, res, next) {
var responded
, timeout = setTimeout(function() {
responded = true
res(null, error(408))
}, 30000)
, timeout
if(req.timeout > 0) {
timeout = setTimeout(function() {
responded = true
res(null, error(408))
}, req.timeout * 1000)
} else {
responded = true
throw new Error('Invalid timeout: must be an integer value greater than 0')
}
next(req, function(err, data) {

@@ -1223,0 +1238,0 @@ clearTimeout(timeout)

2

package.json
{
"name": "@zambezi/address",
"version": "3.0.5",
"version": "3.1.0",
"description": "API for nap resources",

@@ -5,0 +5,0 @@ "main": "lib/address.js",

@@ -307,2 +307,15 @@ # Address

### Adding timeout
When requesting a resource address will by default wait at least 30 seconds for a response from the resource, before returning a `408 Request Timeout` error. By calling the `timeout` method on the request, it is possible to increase or decrease this timeout period. The following example shows how to increase the timeout from the default 30 seconds to 60:
```javascript
// increase the timeout to 60 sec for request to resolve
address("/price/usd/gbp")
.timeout(60)
.json()
.get()
```
The value given to the `timeout` method is in seconds.
## Adding a resource view to the DOM

@@ -309,0 +322,0 @@

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