Reputation: 1270
How can you append to a local file using ClojureScript (running on Node)?
Upvotes: 0
Views: 145
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