Improve and update docs (#42)

* Improve docs and bring them up to date with the latest changes.
* Moves badges into headline.

Note that there are more supported options than documented. As they've not been documented before, they are considered private for now.
2 files changed
tree: fb5d78d74a275153e85466f9ba6df6e4a4ae568d
  1. spec/
  2. .eslintrc.yml
  3. .gitignore
  4. .ratignore
  5. .travis.yml
  6. appveyor.yml
  7. index.js
  8. package.json
  9. README.md
  10. RELEASENOTES.md
README.md

NPM

cordova-fetch Travis Badge AppVeyor Badge

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

Usage

fetch

Installs a module from npm, a git url or the local file system. Returns a Promise resolving to the absolute path to the installed package.

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

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

Parameters

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

uninstall

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

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

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

Parameters

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