michaelrbock
michaelrbock

Reputation: 1270

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

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

Upvotes: 0

Views: 145

Answers (1)

michaelrbock
michaelrbock

Reputation: 1270

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.

Upvotes: 2

Related Questions