The fabrication and design of electrodes that transfer more energy at high rates is very crucial for battery technology because of the increasing need for electrical energy storage. Usually, reducing a material's volume expansion and improving its electrical conductivity can promote electron and Li+/Na+ ion transfer in nanostructured electrodes and improve rate capability and stability. Here, we demonstrate a general metal- Aspergillus niger bioleaching approach for preparing novel fungus-inspired electrode materials that may enable high-performance lithium ion/sodium ion batteries with one-dimensional architectures. The fungus functions as a natural template to provide large amounts of nitrogen/carbon sources, which are functionalized with metal sulfide nanoparticles, yielding various metal sulfide nanoparticles/nitrogen-doped carbonaceous fibers (MS/NCF (MS = ZnS, Co9S8, FeS, Cu1.81S)) with high conductivity. In addition, the as-obtained MS/NCF has a uniform fiber architecture and abundant porous structure, which can also enhance the storage ability for LIBs and SIBs. Taking ZnS/NCF as an example, the material exhibits a high specific capacity of up to 715.5 mAh g-1 (100 cycles) and 455 mAh g-1 (50 cycles) at 0.1 A g-1 for LIBs and SIBs, respectively. This versatile approach for employing a fungus as a sustainable template to form high-performance electrodes may provide a systematic platform for implementing advanced battery designs.