0

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

customcommander
  • 17,580
  • 5
  • 58
  • 84
michaelrbock
  • 1,160
  • 1
  • 11
  • 20

1 Answers1

2

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.

michaelrbock
  • 1,160
  • 1
  • 11
  • 20