Confined growth of 2D MoS2 nanosheets in N-doped pearl necklace-like structured carbon nanofibers with boosted lithium and sodium storage performance.