Socket
Socket
Sign inDemoInstall

gh-got

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-got - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

15

index.js

@@ -5,3 +5,3 @@ 'use strict';

function ghGot(path, opts, cb) {
function ghGot(path, opts) {
if (!path) {

@@ -11,11 +11,6 @@ throw new Error('path required');

if (typeof opts === 'function') {
cb = opts;
opts = {};
}
opts = objectAssign({json: true}, opts);
opts.headers = objectAssign({
accept: 'application/vnd.github.v3+json',
'accept': 'application/vnd.github.v3+json',
'user-agent': 'https://github.com/sindresorhus/gh-got'

@@ -39,3 +34,3 @@ }, opts.headers);

return got(url, opts, cb);
return got(url, opts);
}

@@ -51,4 +46,4 @@

].forEach(function (el) {
ghGot[el] = function (url, opts, cb) {
return ghGot(url, objectAssign({}, opts, {method: el.toUpperCase()}), cb);
ghGot[el] = function (url, opts) {
return ghGot(url, objectAssign({}, opts, {method: el.toUpperCase()}));
};

@@ -55,0 +50,0 @@ });

{
"name": "gh-got",
"version": "1.1.0",
"version": "2.0.0",
"description": "Convenience wrapper for `got` to interact with the GitHub API",

@@ -16,3 +16,3 @@ "license": "MIT",

"scripts": {
"test": "node test.js"
"test": "xo && ava"
},

@@ -37,8 +37,9 @@ "files": [

"dependencies": {
"got": "^3.2.0",
"object-assign": "^2.0.0"
"got": "^4.1.1",
"object-assign": "^4.0.1"
},
"devDependencies": {
"ava": "0.0.4"
"ava": "*",
"xo": "*"
}
}

@@ -22,11 +22,11 @@ # gh-got [![Build Status](https://travis-ci.org/sindresorhus/gh-got.svg?branch=master)](https://travis-ci.org/sindresorhus/gh-got)

got('https://api.github.com/users/sindresorhus', {
json: true
json: true,
headers: {
'accept': 'application/vnd.github.v3+json',
'authorization': 'token ' + token;
'authorization': 'token ' + token
}
}, function (err, data) {
console.log(data.login);
}).then(function (res) {
console.log(res.body.login);
//=> 'sindresorhus'
});
})
```

@@ -39,6 +39,6 @@

ghGot('users/sindresorhus', {token: 'foo'}, function (err, data) {
console.log(data.login);
ghGot('users/sindresorhus', {token: 'foo'}).then(function (res) {
console.log(res.body.login);
//=> 'sindresorhus'
});
})
```

@@ -57,3 +57,3 @@

Can be overriden globally with the `GITHUB_TOKEN` environment variable.
Can be overridden globally with the `GITHUB_TOKEN` environment variable.

@@ -67,3 +67,3 @@ ### endpoint

Can be overriden globally with the `GITHUB_ENDPOINT` environment variable.
Can be overridden globally with the `GITHUB_ENDPOINT` environment variable.

@@ -70,0 +70,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