Coder Social home page Coder Social logo

node-tgz-downloader's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-tgz-downloader's Issues

Create http module

in order to simplify using a proxy we should move all http related function to a seperate module
#12

Not working with react-scripts

Hello,

I've tried your tool to download react-scripts package and the tool freeze at some point... Any idea ?

download-tgz package react-scripts

Regards,

Tarball directory structure to mirror NPM registry

Is it possible to allow the tarballs download directory structure to mirror npm registry? Specifically the .tgz would be in a - directory (e.g. node-tgz-downloader/-/node-tgz-downloader-3.11.2-preview1.tgz)?

The intent is for mirroring npm packages into AirGap environment, something like package-bundle, however package-bundle does not allow you to download packages according to package-lock.json file.

download package.json failed

  • macos 10.13
  • node -v v16.14.2

when I run this command download-tgz package-json ./package.json --directory ./test --registry https://registry.npmjs.org/, it run successfully. but it seems the https turn to http in zsh,and there is no tarballs directory in the ./test directory in the end.
image

download-tgz package-lock is ok

Every package is located in a different folder

Hi, I am using the downloader to pack all packages and dependencies, and upload them to a private NPM repository. It would be much easier to do so if the downloader would put all the tgz files in the same folder, instead of a different folder for each file.
Is it possible to apply this behaviour as an optional argument to the downloader?

Failed to download

Download Rate Limiting

Possible to limit download concurrency (e.g. using p-limit) as I suspect I'm hitting the rate-limit for npm registry? I need to run several times (as previously downloaded tgz are skipped) before the download ran to completion.

image

Tried monkey-patching the original download

const promises = tarballs.map(({ url, directory }, i, arr) => {
const position = `${i + 1}/${arr.length}`;
logger(['downloading'.cyan, position], url);
return _downloadFileWithRetry(url, join(baseDirectory, directory), position, 10);
});
return Promise.all(promises);

with the following and it worked flawlessly.

  const asyncSequentialDownload = async () => {
    for (let i = 0; i < tarballs.length; i++) {
      const { url, directory } = tarballs[i];
      const position = `${i + 1}/${tarballs.length}`;
      logger(['downloading'.cyan, position], url);
      await _downloadFileWithRetry(url, join(baseDirectory, directory), position, 10);
    }
  }

  return asyncSequentialDownload();

proxy

Not working with proxy server, proxy wrote in .npmrc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.