In a prosecution for desertion or for nonsupport, before the trial and with the consent of the defendant, or at the trial, on the entry of a plea of guilty, or after conviction, instead of imposing the penalty, or in addition to the penalty, the court in its discretion, having regard to the circumstances and to the financial ability or earning capacity of the defendant, may make an order accepting the bond of the defendant to the state, in such amount and with such sureties as the court shall prescribe and approve. If there has been a plea of guilty or a conviction, judgment must be suspended until some condition of the bond is violated.
N.D.C.C. ยง 14-07-19