How to create a node programmatically in drupal 10

use Drupal\node\Entity\Node;

$title = 'First article';

$body = 'This is the first article node';

$node = Node::create([

 'type' => 'article',

 'title' => $title,

 'body' => $body,

]);

$node->save();

Category