Apache Cordova Fetch Library

Clone this repo:
  1. 9e62e08 chore: update release audit workflow & license headers (#140) by エリス · 6 weeks ago master
  2. 1a65f0b chore(deps): bump glob from 10.4.5 to 10.5.0 (#139) by dependabot[bot] · 7 weeks ago
  3. f9f3a7f chore(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 (#138) by dependabot[bot] · 7 weeks ago
  4. bc3b4f4 chore: increment package version to 5.0.1-dev by Erisu · 4 months ago
  5. ee5baf5 release(5.0.0): updated release notes & version (fetch-5.0.0) by Erisu · 5 months ago 5.0.x 5.0.0 rel/5.0.0

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