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

httpie

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpie - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

34

dist/httpie.js

@@ -8,6 +8,6 @@ const { parse } = require('url');

let out = '';
let o = { method };
let headers = opts.headers || {};
let { protocol, hostname, port, path } = parse(uri);
let o = { protocol, path, method, hostname, port, headers };
if (protocol === 'http:') o.agent = globalAgent;
Object.assign(o, typeof uri === 'string' ? parse(uri) : uri);
if (o.protocol === 'http:') o.agent = globalAgent;

@@ -27,3 +27,12 @@ let req = request(o, r => {

r.data = out;
(r.statusCode >= 400 ? rej : res)(r);
if (r.statusCode >= 400) {
let err = new Error(r.statusMessage);
err.statusMessage = r.statusMessage;
err.statusCode = r.statusCode;
err.headers = r.headers;
err.data = r.data;
rej(err);
} else {
res(r);
}
});

@@ -46,8 +55,13 @@ });

exports.get = send.bind(null, 'GET');
exports.post = send.bind(null, 'POST');
exports.patch = send.bind(null, 'PATCH');
exports.del = send.bind(null, 'DELETE');
exports.put = send.bind(null, 'PUT');
const get = send.bind(null, 'GET');
const post = send.bind(null, 'POST');
const patch = send.bind(null, 'PATCH');
const del = send.bind(null, 'DELETE');
const put = send.bind(null, 'PUT');
exports.send = send;
exports.del = del;
exports.get = get;
exports.patch = patch;
exports.post = post;
exports.put = put;
exports.send = send;
{
"name": "httpie",
"version": "0.1.2",
"version": "0.2.0",
"repository": "lukeed/httpie",

@@ -18,3 +18,3 @@ "description": "A lightweight, Promise-based wrapper for Node.js HTTP requests~!",

"scripts": {
"build": "node builder",
"build": "bundt",
"pretest": "npm run build",

@@ -33,9 +33,6 @@ "test": "tape test/*.js | tap-spec"

"devDependencies": {
"gzip-size": "^3.0.0",
"mk-dirs": "^1.0.0",
"pretty-bytes": "^4.0.2",
"bundt": "^0.2.0",
"tap-spec": "^5.0.0",
"tape": "^4.9.1",
"terser": "^3.10.0"
"tape": "^4.9.1"
}
}

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