My Typescript skills are a bit rusty. How would I ...
# typescript
r
My Typescript skills are a bit rusty. How would I save Output to a file? I tried to use
apply
but I'm getting errors
Copy code
TypeError: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object
        at Object.writeFileSync (node:fs:2163:5)
Code:
Copy code
cluster.kubeconfig.apply(v => {
    fs.writeFileSync("../test", v);
});
e
Copy code
fs.writeFileSync("../test", JSON.stringify(v), "utf-8")
?
r
That works, I just tried it. I managed to figure it out myself, but tnx for the help 🙂