How to add extra data to a programmatically created node Using Drupal 8 i am importing data from an external source and creating the node programmatically from the controller:

$node = Node::create(array(
  'type' =&gt; 'article',
  'title' =&gt; 'some title'
));
$node-&gt;save();


I want to add some extra field with the external id (e.g. "3cru_81pazBBRbj5e8LZkZ").

Adding of the field should happen programmatically within the module without the need of the user having to add it via the ui.

I have been reading up on this but i have come to the point that tutorials have confused me more then helped me.

Any help would be greatly appreciated.
I found this can easily be done using the Features module. Now i could create the the fields manually and then export them using features and copy the export to my custom module.