This post is over a year old, some of this information may be out of date.

Using the new PnP provisioning engine, you can export the schema for an existing document library or list, then import it in a new environment.

Here is the code using SharePoint PnP powershell.

Connect-PnPOnline "https://yourtenant.sharepoint.com/sites/yoursite" -UseWebLogin
Export-PnPListToProvisioningTemplate -List "Documents" -Out template.xml

#connect to new environment or site
Apply-PnPProvisioningTemplate -Path template.xml

Update

These commands have been renamed to

Export-PnPListToSiteTemplate
Invoke-PnPSiteTemplate