release(5.0.0): updated release notes & version (fetch-5.0.0)
3 files changed
tree: fecf9eaf6d6cae2983a7afeacd67e7d8c66f1110
  1. .github/
  2. spec/
  3. .asf.yaml
  4. .gitignore
  5. .npmignore
  6. .ratignore
  7. CONTRIBUTING.md
  8. eslint.config.js
  9. index.js
  10. licence_checker.yml
  11. LICENSE
  12. NOTICE
  13. package-lock.json
  14. package.json
  15. README.md
  16. RELEASENOTES.md
README.md

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