Apache Cordova Fetch Library

Clone this repo:
  1. d33cbde chore(deps): bump @isaacs/brace-expansion from 5.0.0 to 5.0.1 (#145) by dependabot[bot] · 8 days ago master
  2. 2f7889e chore(deps): bump tar from 7.5.6 to 7.5.7 (#144) by dependabot[bot] · 13 days ago
  3. 65b0f15 chore(deps): bump lodash from 4.17.21 to 4.17.23 (#143) by dependabot[bot] · 3 weeks ago
  4. b511800 chore(deps): bump tar from 7.5.3 to 7.5.6 (#142) by dependabot[bot] · 3 weeks ago
  5. ba3ca80 chore(deps): bump tar and pacote (#141) by dependabot[bot] · 4 weeks ago

cordova-fetch

NPM

Node CI Release Audit codecov.io

This package can be used to install and uninstall Node.js packages using npm.

Usage

fetch

Installs a module from:

  • npm registry
  • git url
  • tarball
    • url
    • file on local file system
  • folder path on local system

Returns a Promise resolving to the absolute path of the installed package.

const fetch = require('cordova-fetch');

fetch(spec, dest, opts).then(pathToInstalledPackage => {
    // Do something
});

Fetch Parameters

ParameterDescription
specA spec for the package to be installed (anything supported by npm install)
destLocation where to install the package
optsAdditional options (optional)
Fetch Options
OptionDefaultDescription
savefalseAdds the package as dependency to package.json iff true

uninstall

Uninstalls a package from the given directory. Returns a Promise that resolves when removal has finished.

const { uninstall } = require('cordova-fetch');

uninstall(packageName, dest, opts).then(() => {
    // Do something
});

Uninstall Parameters

ParameterDescription
packageNameName of the package to be uninstalled
destLocation from where to uninstall the package
optsAn Object with additional options
Uninstall Options
OptionDefaultDescription
savefalseRemoves dependency from package.json iff true