When the application to the court is made without notice to the adverse party and the writ is allowed, the alternative writ must be issued first, but if the application is upon due notice and the writ is allowed, the peremptory writ may be issued in the first instance. The notice of the application, when given, must be at least ten days. The writ cannot be granted by default. The case must be heard by the court whether the adverse party appears or not.
N.D.C.C. § 32-34-04