title: How do I programmatically create a node?
body: <p>I'm designing a new module in Drupal 8. It's a long-term project that won't be going public for a few months at least, so I'm using it as a way to figure out what's new.</p>
  
  <p>In this module, I want to be able to programmatically create nodes. In Drupal 7, I would do this by creating the object, then calling "node_submit" and "node_save".</p>
  
  <p>These functions no longer exist in Drupal 8. Instead, according to the documentation, "Modules and scripts may programmatically submit nodes using the usual form API pattern." I'm at a loss. What does this mean? I've used Form API to create forms in Drupal 7, but I don't get what the docs are saying here.</p>
  
  <p>What I'm looking to do is programmatically create at least one and possibly multiple new nodes, based on information not taken directly from a user-presented form. I need to be able to:</p>
  
  <p>1) Specify the content type</p>
  
  <p>2) Specify the URL path</p>
  
  <p>3) Set any other necessary variables that would previously have been handled by the now-obsolete node_object_prepare()</p>
  
  <p>4) Commit the new node object</p>
  
  <p>I would prefer to be able to do this in an independent, highly abstracted function not tied to a specific block or form.</p>
  
  <p>So what am I missing?</p>