How do you append to a file in ClojureScript (on Node)?

140 views Asked by At

How can you append to a local file using ClojureScript (running on Node)?

1

There are 1 answers

0
michaelrbock On

Use the Node.js fs.appendFileSync method from the fs package, like so:

(.appendFileSync fs "/path/to/file.txt" "string to append")

This will also create the file if it doesn't exist yet.