Equivalent method or "body onload"
This is fairly easy and covered well in the Javascript API section of the drupal docs.

Effectively you want a Javascript file that creates a Drupal behavior (this is automatically fired when the document is ready). Inside the behavior, just call curvycurvy();.

https://www.drupal.org/docs/8/api/javascript-api/javascript-api-overview

So, for starters...

Drupal.behaviors.initCurvy = {
  attach: function (context, settings) {
    curvycurvy();
  }
};