Give me an asynchronous NodeJS function in TypeScript that uses the fs/promises module, already imported as fsp, to create a file at a given path with given data and create its whole directory structure if any of it doesn't exist.
system
mujhe tipscript main ek acincronas nodej fnction den jo ennes/promis modul kaa upyog karata he, jo pehle se hi ennespi ke rup main aayaat kiya gaya he, die gaye data ke saath kisi die gaye path par ek fil banane ke liye or isaki puri nirdeshika sanrachana banaaen yadi isamen se koi bhi maujuud nahin he.
user
yahaan tipscript main ek atulykaalik node fnction he jo kisi die gaye path par ek fil or isaki nirdeshika sanrachana banayega.

async fnction createfile (fil naam: string, data: string) {
    fsp.mkdir (dirname (fil naam), {
        punaravarti: sach
    });
    fsp.writefile (fil naam, data) kaa intjaar;
}
assistant
<|system|>
</s>
<|user|>
mujhe tipscript main ek acincronas nodej fnction den jo ennes/promis modul kaa upyog karata he, jo pehle se hi ennespi ke rup main aayaat kiya gaya he, die gaye data ke saath kisi die gaye path par ek fil banane ke liye or isaki puri nirdeshika sanrachana banaaen yadi isamen se koi bhi maujuud nahin he.</s>
<|assistant|>
yahaan tipscript main ek atulykaalik node fnction he jo kisi die gaye path par ek fil or isaki nirdeshika sanrachana banayega.

async fnction createfile (fil naam: string, data: string) {
    fsp.mkdir (dirname (fil naam), {
        punaravarti: sach
    });
    fsp.writefile (fil naam, data) kaa intjaar;
}</s>
