Added ascendingOrder option support to pure JS implementation of createNode method