getProject

  • function
 

Copies or downloads a project to project.path.

documentjs.configured.getProject( project )

Parameters

  1. project {Object}

    A projectConfig object with the following properties:

    • source {String}

      A path to a file, a url to a git repository, or a npm install target.

    • npmInstall {Boolean}

      Set to true to use npm to install the resource.

    • path {String}

      The path to install the project.

Returns

{Promise}

A promise that resolves when the resource has been retrieved successfully.

Use

By default, getProject will simply download the repository to project.path:

documentjs.configured.getResource({
  source: "git://github.com/bitovi/comparify#master",
  path: __dirname+"/tmp"
}).then(function(){
    // retrieved!
  });

If you want npm to install the resource:

documentjs.configured.getResource(
  {
    source: "comparify@0.2.0",
    npmInstall: true,
    path: __dirname+"/tmp"
  },
  ).then(function(){
    // retrieved!
  });