T
T
TempUserMain2014-04-07 15:59:47
JavaScript
TempUserMain, 2014-04-07 15:59:47

How to upload files from Git using JS \ Node?

There is a remote git repository.
Tell me, please, is it possible to download certain files from the repository using JavaScript or Node.js? If so, how?
UPD:
You can use the http.get() function to download a file :

var http = require('http');
var fs = require('fs');

var file = fs.createWriteStream("file.png");
var request = http.get("http://im.glogster.com/media/2/5/24/10/5241033.png", function(response) {
  response.pipe(file);
});

The example is taken from the answer to StackOverflow
However, if you replace http with https and specify the path to the file in the repository with the *.exe extension, then the file is downloaded incorrectly, for example, instead of 6MB, only 5KB.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Velichko, 2014-04-07
@Zoxon

npm install https://github.com/indexzero/forever/tarball/v0.5.6

https://www.npmjs.org/doc/cli/npm-install.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question