creating composer package magento 2 code example
Example 1: install magento 2 using composer
1
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <install-directory-name>
Example 2: install magento 2 command line composer
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .