There is no atmosphere in space so there is nothing that conducts kinetic force to the object...a nuke unless buried in an offending asteroid would simply be an instant flash of intense light ...then nothing! The exposed asteroid might melt into vapor if it was small enough but only be singed on the exposed side if it was very large!
It would depend on the proportion of energy carried away from the blast as kinetic energy of material vs. electromagnetic. I would think that such a bomb would be designed to yield a barrage of high speed matter impinging on the asteroid, a shaped charge of lead or depleted uranium to the asteroid side. I’m confident that we would not send a neutron bomb to do the job.