Apache Cordova Fetch Library

Clone this repo:
  1. e19bd92 chore(deps): bump the gh-actions-patch-minor group across 1 directory with 3 updates (#189) by dependabot[bot] · 7 days ago master
  2. a8b5e3f chore(deps): bump the npm-patch group across 1 directory with 2 updates (#192) by dependabot[bot] · 7 days ago
  3. 52191c3 chore(deps): bump undici from 6.29.0 to 6.29.1 (#190) by dependabot[bot] · 13 days ago
  4. 11d3b01 chore(deps): bump ip-address from 10.7.2 to 10.7.5 (#191) by dependabot[bot] · 13 days ago
  5. 14cc654 chore(deps): bump postcss-selector-parser from 7.1.5 to 7.1.6 (#186) by dependabot[bot] · 5 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