Is there a Drupal API function to get the list of nodes by type? Is there a Drupal API function like node_load() that will return a list of nodes by a given type?

I've tried $nodes = node_load(array("type" =&gt; 'student_vote')), but it only returns one node. 

I know I could code up something like node_load(), but I wanted to see if there might be anything like that out there already.
Depending on the version of Drupal :

drupal 6:

$nodes = db_query('SELECT nid FROM {node} WHERE type="%s"', $type);

drupal 7: 

$nodes = node_load_multiple(array(), array('type' =&gt; $type));

drupal 8: 

$nids = \Drupal::entityQuery('node')
  -&gt;condition('type', 'NODETYPE')
  -&gt;execute();
$nodes = \Drupal::entityTypeManager()
  -&gt;getStorage('node')
  -&gt;loadMultiple($nids);