New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ghify-request

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghify-request

Create a Request wrapper to interact with the GitHub API

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

ghify-request

NPM version Build Status Coverage Status Dependency Status devDependency Status

Create a Request wrapper to interact with the GitHub API

const ghifyRequest = require('ghify-request');
const request = require('request');

const ghifiedRequest = ghifyRequest(request);
ghifiedRequest('users/shinnn', (err, response, body) => {
  body.login; //=> 'shinnn'
})

Installation

Use npm.

npm install ghify-request

API

const ghifyRequest = require('ghify-request');

ghifyRequest(request[, options])

request: Function (Request function)
options: Object (Request options)
Return: Function (new Request wrapper)

It returns a Request wrapper that defaults to the options for easily interacting with the GitHub API.

options.token

Type: String
Default: process.env.GITHUB_TOKEN

Use specific GitHub access token.

const ghifyRequest = require('ghify-request');
const request = require('request');

// https://developer.github.com/v3/gists/#star-a-gist
ghifyRequest(request, {
  token: 'xxxxxxx' // your personal access token
}).put({
  uri: '/gists/908bced575270f6ef80e/star'
}).on('response', () => {
  console.log('Starred the gist https://gist.github.com/shinnn/908bced575270f6ef80e.');
});

options.baseUrl

Type: String
Default: process.env.GITHUB_ENDPOINT if available, otherwise 'https://api.github.com'

Use the different endpoint to support Github enterprise.

License

Copyright (c) 2015 - 2016 Shinnosuke Watanabe

Licensed under the MIT License.

Keywords

request

FAQs

Package last updated on 28 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts