When a criminal action is pending in a local criminal court, such court, upon application of a defendant, shall proceed as follows:
When the defendant is charged, by felony complaint, with a felony, the court may, in its discretion, and in accordance with section 510.10 of this title, order recognizance, release under non-monetary conditions, or, where authorized, fix bail, or order non-monetary conditions in conjunction with fixing bail, or commit the defendant to the custody of the sheriff except as otherwise provided in subdivision one of this section or this subdivision:
N.Y. Crim. Proc. Law § 530.20