Giter Site home page Giter Site logo

mongodb-downloader's Introduction

mongodb-downloader

This downloads a MongoDB release zip/tgz from fastdl.mongodb.org.

It is heavily influenced by electron-download and mongodb-download

Usage

Note: Requires Node >= 4.0 to run.

$ npm install --global mongodb-downloader
$ mongodb-download --version=3.6.0
const download = require('mongodb-downloader')

download({
  version: '3.6.0',
  arch: 'ia32',
  platform: 'win32',
  cache: './archives'
}, function (err, archivePath) {
  // archivePath will be the path of the archive that it downloaded.
  // If the archive was already cached it will skip
  // downloading and call the cb with the cached archive path.
  // If it wasn't cached it will download the archive and save
  // it in the cache path.
})

If you don't specify arch or platform args it will use the built-in os module to get the values from the current OS. Specifying version is mandatory. If there is a SHASUMS256.txt file available for the version, the file downloaded will be validated against its checksum to ensure that it was downloaded without errors.

If you would like to override the mirror location, three options are available. The mirror URL is composed as url = MONGODB_MIRROR + '/' + MONGODB_CUSTOM_DIR + '/' + MONGODB_CUSTOM_FILENAME.

You can set the MONGODB_MIRROR or NPM_CONFIG_MONGODB_MIRROR environment variable or mirror opt variable to use a custom base URL for grabbing MONGODB zips. The same pattern applies to MONGODB_CUSTOM_DIR and MONGODB_CUSTOM_FILENAME:

or for a local mirror

MONGODB_MIRROR="https://10.1.2.105/" MONGODB_CUSTOM_DIR="our/internal/filePath"


You can set MONGODB_MIRROR in `.npmrc` as well, using the lowercase name:

```plain
mongodb_mirror=https://10.1.2.105/

Cache location

The location of the cache depends on the operating system, the defaults are:

  • Linux: $XDG_CACHE_HOME or ~/.cache/mongodb/
  • MacOS: ~/Library/Caches/mongodb/
  • Windows: $LOCALAPPDATA/mongodb/Cache or ~/AppData/Local/mongodb/Cache/

You can set the MONGODB_CACHE environment variable to set cache location explicitly.

mongodb-downloader's People

Contributors

alphapseudo avatar fracmak avatar nodkz avatar s73obrien avatar tumetsu avatar welps avatar winfinit avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.