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

request-with-cookies

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-with-cookies - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

12

lib/index.js

@@ -5,6 +5,10 @@ var request;

module.exports.createClient = function() {
return request.defaults({
jar: request.jar()
});
module.exports.createClient = function(options) {
if (options == null) {
options = {};
}
if (options.jar == null) {
options.jar = request.jar();
}
return request.defaults(options);
};
{
"name": "request-with-cookies",
"version": "0.0.1",
"version": "0.0.2",
"description": "An enhancement to mikeal/request library to create reusuable clients that supports cookies per client",

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

@@ -25,2 +25,20 @@ request-with-cookies

You can also create a client with baked in options
```javascript
var request = require("request-with-cookies");
var options = {
qs: {
q: "foo"
}
};
var client = request.createClient(options);
// now every request will be sent with "?q=foo" appended to the URL
client("http://www.google.com", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body) // Prints the google web page.
}
});
```
## Implementation details

@@ -27,0 +45,0 @@

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