/**
 * Implements hook_entity_view_alter().
 */
function {{ machine_name }}_entity_view_alter(array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) {
  if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {
    // Change its weight.
    $build['an_additional_field']['#weight'] = -10;

    // Add a #post_render callback to act on the rendered HTML of the entity.
    // The object must implement \Drupal\Core\Security\TrustedCallbackInterface.
    $build['#post_render'][] = '\Drupal\my_module\NodeCallback::postRender';
  }
}
