Adding HTML tags in the <head> in Drupal 8 with a module

Step 1
Create a MODULNAME.libraries.yml file with: dependencies: - core/drupalSettings"!

MODULNAME:
version: VERSION
dependencies:
- core/drupalSettings
- core/drupal

Step 2
Add this hook_page_attachments() function in your module (MODULNAME.module):

/**
* Implements hook_page_attachments().
*/
function MODULNAME_page_attachments(array &$page) {
$description = [
'#tag' => 'script',
'#attributes' => [
'name' => 'description',
'content' => 'My script.',
],
];
$page['#attached']['html_head'][] = [$description, 'description'];
}

Zwahlendesign: