hello_world_page_attachments is not called I was following the documentation about creating a custom hello world module.
I got to the point where you are told how to attach custom JavaScript and CSS files using hooks. I want to get a JavaScript file attached on every page. Unfortunately, I can't manage it to work. Everything was working, so far.

This is the code I am using.

hello_world.libraries.yml

hello_world:
  version: 1.x
  css:
    theme:
      css/style.css: {}
  js:
    js/hello_world.js: {}
  dependencies:
    - core/jquery


hello_world.module

function hello_world_page_attachments(array &amp;$attachments) {
  $attachments['#attached']['library'][] = 'hello_world_for_drupal_8/hello_world';
}


hello_world.js

alert("outside script");
console.log("outside script");
Libraries are refererred to as module_machine_name/library_name

If the other names in your post are accurate, in your case that should be:

$attachments['#attached']['library'][] = 'hello_world/hello_world';