https://pulumi.com logo
#typescript
Title
# typescript
r

rhythmic-whale-48997

04/05/2022, 8:14 AM
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

echoing-dinner-19531

04/05/2022, 8:19 AM
Copy code
fs.writeFileSync("../test", JSON.stringify(v), "utf-8")
?
r

rhythmic-whale-48997

04/05/2022, 8:24 AM
That works, I just tried it. I managed to figure it out myself, but tnx for the help 🙂