How to use composer for module dependency?
See this composer template for Drupal project for an example of how this works. Usage:

composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction


With composer require ... you can download new dependencies to your installation.

cd some-dir
composer require drupal/devel:~1.0