The morphology and electrochemical properties of porous Fe2O3@C and FeS@C nanofibers as stable and high-capacity anodes for lithium and sodium storage.