composer install drupal 8 code example
Example 1: drupal 8 composer update
composer update drupal/core "drupal/core-*" --with-all-dependencies
Example 2: composer drupal install
composer create-project drupal/recommended-project my_site_name_dir
Example 3: download specific version of drupal using composer
composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --no-interaction --no-install