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 7.0.0 to 7.1.0

4

index.js

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

token: env.GITHUB_TOKEN,
endpoint: env.GITHUB_ENDPOINT ? env.GITHUB_ENDPOINT.replace(/[^/]$/, '$&/') : 'https://api.github.com/'
endpoint: env.GITHUB_ENDPOINT ? env.GITHUB_ENDPOINT : 'https://api.github.com/'
}, opts);

@@ -33,3 +33,3 @@

const url = /^https?/.test(path) ? path : opts.endpoint + path;
const url = /^https?/.test(path) ? path : opts.endpoint.replace(/\/$/, '') + '/' + path.replace(/^\//, '');

@@ -36,0 +36,0 @@ if (opts.stream) {

{
"name": "gh-got",
"version": "7.0.0",
"description": "Convenience wrapper for Got to interact with the GitHub API",
"license": "MIT",
"repository": "sindresorhus/gh-got",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"got",
"gh",
"github",
"api",
"request",
"http",
"https",
"get",
"url",
"uri",
"util",
"utility"
],
"dependencies": {
"got": "^8.0.0",
"is-plain-obj": "^1.1.0"
},
"devDependencies": {
"ava": "*",
"get-stream": "^3.0.0",
"nock": "^9.1.0",
"xo": "*"
}
"name": "gh-got",
"version": "7.1.0",
"description": "Convenience wrapper for `got` to interact with the GitHub API",
"license": "MIT",
"repository": "sindresorhus/gh-got",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"got",
"gh",
"github",
"api",
"request",
"http",
"https",
"get",
"url",
"uri",
"util",
"utility"
],
"dependencies": {
"got": "^8.0.0",
"is-plain-obj": "^1.1.0"
},
"devDependencies": {
"ava": "*",
"get-stream": "^3.0.0",
"nock": "^9.1.0",
"xo": "*"
}
}

@@ -21,12 +21,14 @@ # 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,
headers: {
'accept': 'application/vnd.github.v3+json',
'authorization': `token ${token}`
}
}).then(res => {
console.log(res.body.login);
(async () => {
const {body} = await got('https://api.github.com/users/sindresorhus', {
json: true,
headers: {
'accept': 'application/vnd.github.v3+json',
'authorization': `token ${token}`
}
});
console.log(body.login);
//=> 'sindresorhus'
});
})();
```

@@ -39,6 +41,8 @@

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

@@ -51,6 +55,8 @@

ghGot('https://api.github.com/users/sindresorhus', {token: 'foo'}).then(res => {
console.log(res.body.login);
(async () => {
const {body} = await ghGot('https://api.github.com/users/sindresorhus', {token: 'foo'});
console.log(body.login);
//=> 'sindresorhus'
});
})();
```

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