Sunday, 14 May 2017

Download tarball to computer with Node.js

If I have a tarball in my project directory, is it possible to force download it using Node.js?

Structure:

    Project
    -images
      --image1
      --image2
    -node_modules
    -compress.tar.gz

Ive made tarballs using

     var read = targz().createReadStream("./images/"+variableName);
      var write = fs.createWriteStream(variableName+'.tar.gz');
      read.pipe(write);

But I'm trying to download these if possible I'm just unsure how I'd go about it. Thanks!



via user

No comments:

Post a Comment