Can I have a TS Node function that recursively copies a file or directory from one path to another? Place a comment at the end of each line explaining what it's doing. It should be asynchronous.
system
kya mere paas ek ties node fnction ho saktaa he jo punaravarti rup se ek fil yaa nirdeshika ko ek path se duusare maarg par copy karata he?prayek pankti ke ant main ek tippanee rakhen jo yah bataa rahaa he ki yah kya kar rahaa he.yah atulykaalik hona chahie.
user
avashya.yahan ek fil yaa nirdeshika ko punaravarti rup se copy karne ke liye ek acincronas tipscript fnction he!

"fs" se aayaat {vaade};
aayaat {JOIN} "path" se;
Async fnction copy (SRC: string, gantavy: string): vaada <void> {
    const stat = aittate provess.stat (src);// se copy karne ke liye strot kii sthiti praapt karen.

    if (stat.isdirectory ()) {// yadi strot ek nirdeshika he:
        const nihit = ATAIT PROMISES.READDIR (SRC);// nirdeshika kii saamagree padhein.
        vaada karen. sabhi (// sabhi utpaadit vaadon ko hal karne ke liye pratiksha karen.
            conted.map ((fil) => copy (JOIN (SRC, fil), JOIN (gantavy, fil))) // nirdeshika main nihit prayek fil ko apane gantavy path par copy karen.
        );
    } or agar (stat.isfile ()) {// yadi strot ek fil he:
        vaada karata he.// yadi yah maujuud nahin he to fil kaa path banaaen.
        vaada karte hai.// fil ko gantavy par copy karen.
    }
}
assistant
<|system|>
</s>
<|user|>
kya mere paas ek ties node fnction ho saktaa he jo punaravarti rup se ek fil yaa nirdeshika ko ek path se duusare maarg par copy karata he?prayek pankti ke ant main ek tippanee rakhen jo yah bataa rahaa he ki yah kya kar rahaa he.yah atulykaalik hona chahie.</s>
<|assistant|>
avashya.yahan ek fil yaa nirdeshika ko punaravarti rup se copy karne ke liye ek acincronas tipscript fnction he!

"fs" se aayaat {vaade};
aayaat {JOIN} "path" se;
Async fnction copy (SRC: string, gantavy: string): vaada <void> {
    const stat = aittate provess.stat (src);// se copy karne ke liye strot kii sthiti praapt karen.

    if (stat.isdirectory ()) {// yadi strot ek nirdeshika he:
        const nihit = ATAIT PROMISES.READDIR (SRC);// nirdeshika kii saamagree padhein.
        vaada karen. sabhi (// sabhi utpaadit vaadon ko hal karne ke liye pratiksha karen.
            conted.map ((fil) => copy (JOIN (SRC, fil), JOIN (gantavy, fil))) // nirdeshika main nihit prayek fil ko apane gantavy path par copy karen.
        );
    } or agar (stat.isfile ()) {// yadi strot ek fil he:
        vaada karata he.// yadi yah maujuud nahin he to fil kaa path banaaen.
        vaada karte hai.// fil ko gantavy par copy karen.
    }
}</s>
