Skip to content

Instantly share code, notes, and snippets.

@miwaniec
miwaniec / download-github-repo.js
Created September 1, 2019 18:31
Download zipped repository from github. If repo is private, you have to use token (create in user profile).
const request = require('request');
const fs = require('fs');
const repo = 'miwaniec/socket-camera';
const accessToken = ''; /* for private repo, use token - https://github.com/settings/tokens */
var options = {
method: 'GET',
url: 'https://api.github.com/repos/' + repo + '/zipball/',
encoding: 'binary',