moved build_index into nodejs