Fetch templates to a temporary directory

This reduces pollution of user's home directory and definitely makes
the previously performed makeshift cache-busting obsolete since we fetch
into a fresh temp directory every time.

Addresses §6 of https://github.com/apache/cordova-discuss/issues/89

Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
3 files changed
tree: c0fd4c8f25548aaaf2189dbda6f026cac3e40629
  1. .github/
  2. spec/
  3. .eslintrc.yml
  4. .gitignore
  5. .npmignore
  6. .ratignore
  7. .travis.yml
  8. appveyor.yml
  9. index.js
  10. LICENSE
  11. package.json
  12. README.md
  13. RELEASENOTES.md
README.md

Build status Build Status

cordova-create

This module is used for creating cordova style projects. It also incudes support for cordova templates. It can fetch templates from npm and git.

Usage:

:

var create = require('cordova-create');

create(dir, id, name, cfg, extEvents);

dir - directory where the project will be created. Required. id - app id. Required (but can be “undefined”). name - app name. Required (but can be “undefined”). cfg - extra config to be saved in .cordova/config.json Required (but can be “{}”). extEvents - An EventEmitter instance that will be used for logging purposes. Required (but can be “undefined”).

An example of cfg which would fetch a cordova template from npm (or git):

var cfg = {
    lib: {
        www: {
            template: true,
            url: 'cordova-app-hello-world',
            version: ''
        }
    }
};